You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I was tinkering around and profiling GraphQL Ruby around a year ago, I found some small+easy perf wins from optimizing some commonly queried "predicate methods", by defining them via attr_reader. I've lost the benchmarks, and don't have time to recreate them, but I still figured it's worth sharing the idea here.
When I was tinkering around and profiling GraphQL Ruby around a year ago, I found some small+easy perf wins from optimizing some commonly queried "predicate methods", by defining them via
attr_reader
. I've lost the benchmarks, and don't have time to recreate them, but I still figured it's worth sharing the idea here.Unfortunately, Ruby makes these unnecessarily ugly/difficult in the case of boolean attributes, but still possible with this method swizzling dance:
The main cuplrits were in
type_kind.rb
. I've opened a PoC PR here: #5082Candidates for this kind of replacement can be found with these 2 regexes:
(They can be merged into one, but I opted not to, just to keep them somewhat legible)
Would you be able to take a quick stab at benchmarking these? And in general, do you think those perf wins are worth this ugliness?
The text was updated successfully, but these errors were encountered: