Performance regression in activerecord scoping


#1

I opened this issue on the performance regression with scoping in the new release of rails from 4.2. I ran memory profiler on 4.1.10 and 4.2.0.

It’s only portion of the output from memory profiler, but how do the results look?

For example, I noticed that in 4.1.10 allocated memory for query_methods.rb was about 66 MB, but then in 4.2.0 it jumped to 162 MB.


#2

Could you post the diff of that method between 4.1.10 against 4.2.0? :smiley:


#3

Here’s a paste bin 4.1.10 4.2.0 diff on query_methods.rb - Pastebin.com


#4

Ok lets zoom in further. Now we know the file that is taking up more memory, we need to figure out which change in that file is the culprit. :smile:


#5

Btw be sure to benchmark against Rails head too. We might be doing all the work here when Rails head has already recovered the performance.


#6

Seems like that’s the case since memory usage for query_methods.rb decreased when testing against master, but at the same time it feels like my tests are off.