regurgitator RubyGem user+dev discussion/patches/pulls/bug/help
 help / color / mirror / code / Atom feed
* [PATCH] local_file: clear string buffer if #each is used
@ 2016-11-05  2:05 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2016-11-05  2:05 UTC (permalink / raw)
  To: regurgitator-public

Allow the VM and malloc implementation to recover the 16K buffer
immediately after we're done with it.  This reduces GC pressure
and should reduce fragmentation and improve locality.
---
 lib/regurgitator/local_file.rb | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/regurgitator/local_file.rb b/lib/regurgitator/local_file.rb
index 39c540a..21a5020 100644
--- a/lib/regurgitator/local_file.rb
+++ b/lib/regurgitator/local_file.rb
@@ -72,6 +72,7 @@ class Regurgitator::LocalFile # :nodoc:
           yield buf
         end
       end
+      buf.clear
     end
   end
 
-- 
EW


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2016-11-05  2:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-05  2:05 [PATCH] local_file: clear string buffer if #each is used Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/regurgitator.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).