raindrops RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
From: Eric Wong <e@80x24.org>
To: raindrops-public@bogomips.org
Subject: [PATCH 3/3] aggregate/pmq: avoid File#stat allocation
Date: Thu, 16 Mar 2017 03:14:12 +0000	[thread overview]
Message-ID: <20170316031412.16713-4-e@80x24.org> (raw)
In-Reply-To: <20170316031412.16713-1-e@80x24.org>

File#size is available in modern Rubies so the extra syscall
is avoided.
 lib/raindrops/aggregate/pmq.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/raindrops/aggregate/pmq.rb b/lib/raindrops/aggregate/pmq.rb
index 5a6a1f6..98d4169 100644
--- a/lib/raindrops/aggregate/pmq.rb
+++ b/lib/raindrops/aggregate/pmq.rb
@@ -153,7 +153,7 @@ def aggregate
       Marshal.load(synchronize(@rd, RDLOCK) do |rd|
         dst = StringIO.new
-        IO.copy_stream(rd, dst, rd.stat.size, 0)
+        IO.copy_stream(rd, dst, rd.size, 0)

  parent reply	other threads:[~2017-03-16  3:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-16  3:14 [PATCH 0/3] aggregate/pmq: various fixes and cleanups Eric Wong
2017-03-16  3:14 ` [PATCH 1/3] aggregate/pmq: avoid false sharing of lock buffers Eric Wong
2017-03-16  3:14 ` [PATCH 2/3] aggregate/pmq: remove io-extra requirement Eric Wong
2017-03-16  3:14 ` Eric Wong [this message]
2017-03-21 23:48 ` [PATCH 0/3] aggregate/pmq: various fixes and cleanups Eric Wong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://yhbt.net/raindrops/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170316031412.16713-4-e@80x24.org \
    --to=e@80x24.org \
    --cc=raindrops-public@bogomips.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


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).