diff options
author | Stan Hu <stanhu@gmail.com> | 2019-06-20 21:49:14 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-08-27 16:56:57 -0700 |
commit | 76f4615aca2d9744590191aa5cdf0daf10ef62c8 (patch) | |
tree | 44a1f8a151143e66f4157d573edb0f1d16b9fdde /doc | |
parent | 0ef49746ad4ab732c9645fb709676c32cb3ea389 (diff) | |
download | gitlab-ce-sh-disable-replace-methods-batch-loader.tar.gz |
Speed up MR widget by disabling BatchLoader replace_methodssh-disable-replace-methods-batch-loader
We've seen a significant performance penalty when using
`BatchLoader#__replace_with!`. This defines methods on the batch loader
that proxy to the 'real' object using send. The alternative is
`method_missing`, which is slower. However, we've noticed that
`method_missing` can be faster if:
1. The objects being loaded have a large interface.
2. We don't call too many methods on the loaded object.
In proudction, we've observed a small percentage of time used
in Module#define_methods as a result of the BatchLoader. Disabling this
for ActiveRecord models is generally a good thing to do since there are
so many methods.
Diffstat (limited to 'doc')
0 files changed, 0 insertions, 0 deletions