deface icon indicating copy to clipboard operation
deface copied to clipboard

Memory allocations

Open ProGM opened this issue 7 years ago • 0 comments

I've noticed a peak of memory allocations in this file by using derailed gem

       800  /Users/progm/.rbenv/versions/2.3.5/lib/ruby/gems/2.3.0/gems/deface-1.0.2/lib/deface/search.rb:13
       400  /Users/progm/.rbenv/versions/2.3.5/lib/ruby/gems/2.3.0/gems/deface-1.0.2/lib/deface/override.rb:189

That could be simply fixed using a .freeze.

  • Freezing empty strings
  • use compact! instead of compact

ProGM avatar May 18 '18 14:05 ProGM