Finding Ruby Performance Hotspots via Allocation Stats
29-Nov-2018 1949
RubyParser is a library written by Ryan Davis for parsing Ruby code and producing an abstract syntax tree. It is used by Brakeman and several other static analysis gems.Recently I was poking around to see if there was any low-hanging fruit for performance improvements. At first, I was interested in the generated parsers. Racc outputs some crazy arrays of state machine changes. Instead of generating arrays of integers, it outputs arrays of strings, then splits those strings into integers which it loads into the final array. I thought for sure skipping this and starting with the final array of integers would be faster, but…somehow it wasn’t.
Finding Ruby Performance Hotspots via Allocation Stats #ruby #rubydeveloper #rubyonrails #Finding #Performance #Hotspots #Allocation #Stats #performance https://www.rubyonrails.ba/link/finding-ruby-performance-hotspots-via-allocation-stats