Closed cbliard closed 8 years ago
Parslet::Pattern allocates 3 to 4 arrays just to do comparisons each time #element_match is called.
Parslet::Pattern
#element_match
This little patch avoids these allocations.
In one of our usecase we saw memory allocated by parslet gem going from 440 to 336 MiB (-25%) using memory-profiler gem to measure it.
Parslet::Pattern
allocates 3 to 4 arrays just to do comparisons each time#element_match
is called.This little patch avoids these allocations.
In one of our usecase we saw memory allocated by parslet gem going from 440 to 336 MiB (-25%) using memory-profiler gem to measure it.