[
https://issues.apache.org/jira/browse/THRIFT-401?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12688881#action_12688881
]
Tyler Kovacs commented on THRIFT-401:
-------------------------------------
> If you do "rake gen-rb" first, then it'll be there.
Not having any luck with that either.
# rake gen-rb --trace
(in /root/thrift/lib/rb)
** Invoke gen-rb (first_time)
** Invoke gen-rb:spec (first_time)
** Execute gen-rb:spec
../../compiler/cpp/thrift --gen rb -o /root/thrift/lib/rb/spec
/root/thrift/lib/rb/spec/ThriftSpec.thrift
rake aborted!
Command failed with status (127): [../../compiler/cpp/thrift --gen rb -o
/roo...]
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:971:in `sh'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:984:in `call'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:984:in `sh'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1072:in `sh'
/root/thrift/lib/rb/Rakefile:35
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in
`invoke_with_call_chain'
/usr/local/lib/ruby/1.8/monitor.rb:238:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in
`invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:588:in
`invoke_prerequisites'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in
`invoke_prerequisites'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:577:in
`invoke_with_call_chain'
/usr/local/lib/ruby/1.8/monitor.rb:238:in `synchronize'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in
`invoke_with_call_chain'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in `invoke_task'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in
`standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in
`standard_exception_handling'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in `run'
/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
/usr/local/bin/rake:19:in `load'
/usr/local/bin/rake:19
There's a ../../compiler/cpp directory but no executable called "thrift". The
install instructions from the README in that directory didn't help either.
# ls -l ../../compiler/cpp/thrift
ls: ../../compiler/cpp/thrift: No such file or directory
# ls -l ../../compiler/cpp
total 12
-rw-r--r-- 1 root root 3464 Mar 24 12:16 Makefile.am
-rw-r--r-- 1 root root 711 Mar 24 12:16 README
drwxr-xr-x 5 root root 4096 Mar 24 12:16 src
> ruby transport class read buffer very slow due to usage of slice!
> -----------------------------------------------------------------
>
> Key: THRIFT-401
> URL: https://issues.apache.org/jira/browse/THRIFT-401
> Project: Thrift
> Issue Type: Improvement
> Components: Library (Ruby)
> Environment: # uname -a
> Linux zvm.local 2.6.9-78.0.1.ELsmp #1 SMP Tue Aug 5 11:02:47 EDT 2008 i686
> i686 i386 GNU/Linux
> Reporter: Tyler Kovacs
> Priority: Minor
> Attachments: after.png, before.png,
> remove_slice_from_framed_transport.diff
>
>
> We use Thrift as a cross-language transport for Hypertable - an open-source
> distributed database. While profiling queries with large response using the
> ruby Thrift libraries, we discovered that the majority of time was spent in
> thrift/transport.rb. Specifically, the slice! method, which is used to
> manage the read buffer (@rbuf) was responsible for almost all latency.
> We tried an alternative implementation that showed 300x speedup in our tests.
> Instead of repeatedly calling slice! to alter @rbuf (which apparently is
> extremely expensive), we maintain an offset counter (@rpos) which starts at
> zero and is incremented by sz each time we read from @rbuf. Before and after
> screenshots from kcachegrind are attached.
> I'll copy the monkey patch that we use within the description below - and
> I'll try to assemble a patch later today.
> module Thrift
> class FramedTransport < Transport
> def initialize(transport, read=true, write=true)
> @transport = transport
> @rbuf = ''
> @wbuf = ''
> @read = read
> @write = write
> @rpos = 0
> end
> def read(sz)
> return @transport.read(sz) unless @read
> return '' if sz <= 0
> read_frame if @rpos >= @rbuf.length
> @rpos += sz
> @rb...@rpos - sz, sz] || ''
> end
> def borrow(requested_length = 0)
> read_frame if @rpos >= @rbuf.length
> # there isn't any more coming, so if it's not enough, it's an error.
> raise EOFError if requested_length > (@rbuf.length - @rpos)
> @rb...@rpos, requested_length]
> end
> def consume!(size)
> @rpos += size
> @rb...@rpos - size, size]
> end
> private
> def read_frame
> sz = @transport.read_all(4).unpack('N').first
> @rpos = 0
> @rbuf = @transport.read_all(sz)
> end
> end
> end
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.