Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #4694

Re: Need for speed - array operations

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!feeder.news-service.com!feeds.phibee-telecom.net!talisker.lacave.net!lacave.net!not-for-mail
From Joel VanderWerf <joelvanderwerf@gmail.com>
Newsgroups comp.lang.ruby
Subject Re: Need for speed - array operations
Date Tue, 17 May 2011 16:23:52 -0500
Organization Service de news de lacave.net
Lines 20
Message-ID <4DD2E763.4010600@gmail.com> (permalink)
References <2c5b9893b3d3fa487c6b9737df7c8df2@ruby-forum.com> <e2c62ac1401e32aa2201191e88271de7@ruby-forum.com>
NNTP-Posting-Host bristol.highgroove.com
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-Trace talisker.lacave.net 1305667465 45744 65.111.164.187 (17 May 2011 21:24:25 GMT)
X-Complaints-To abuse@lacave.net
NNTP-Posting-Date Tue, 17 May 2011 21:24:25 +0000 (UTC)
In-Reply-To <e2c62ac1401e32aa2201191e88271de7@ruby-forum.com>
X-Received-From This message has been automatically forwarded from the ruby-talk mailing list by a gateway at comp.lang.ruby. If it is SPAM, it did not originate at comp.lang.ruby. Please report the original sender, and not us. Thanks! For more details about this gateway, please visit: http://blog.grayproductions.net/categories/the_gateway
X-Mail-Count 383404
X-Ml-Name ruby-talk
X-Rubymirror Yes
X-Ruby-Talk <4DD2E763.4010600@gmail.com>
Xref x330-a1.tempe.blueboxinc.net comp.lang.ruby:4694

Show key headers only | View raw


On 05/17/2011 01:26 PM, Pirogov Eugene wrote:
> I'm experience the loss of speed in NArrays. Did you guys tried benching
> a simple access to an element in NArray?
>
> My benches show dramatical slowdown comparing to a Ruby built-in Array.
> I already filled an issue here:
> https://github.com/masa16/narray/issues/8.
>

It's too simple a benchmark to demonstrate the efficiency of narray. 
What it's measuring is access time from ruby. For the first two cases, 
the number in the ruby array is a fixnum (shifted by one bit and or-ed 
with 0x01) that can simply be returned with no modification, as a 32 or 
64 bit VALUE (ruby's basic data type). In the third case, the number is 
stored as an 8 bit signed int, which has to be converted to VALUE by 
sign extending, shifting, and or-ing.

As soon as you start measuring operations whose inputs and outputs are 
both NArrays (especially large ones), you'll see the speed...

Back to comp.lang.ruby | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Need for speed - array operations Chris Lervag <chris.lervag@gmail.com> - 2011-04-29 03:54 -0500
  Re: Need for speed - array operations Ralf Mueller <ralf.mueller@zmaw.de> - 2011-04-29 06:05 -0500
    Re: Need for speed - array operations Robert Klemme <shortcutter@googlemail.com> - 2011-04-29 06:23 -0500
  Re: Need for speed - array operations Chris Lervag <chris.lervag@gmail.com> - 2011-04-29 09:05 -0500
  Re: Need for speed - array operations Chris Lervag <chris.lervag@gmail.com> - 2011-04-29 16:45 -0500
  Re: Need for speed - array operations Pirogov Eugene <iamexile@gmail.com> - 2011-05-17 15:26 -0500
    Re: Need for speed - array operations Joel VanderWerf <joelvanderwerf@gmail.com> - 2011-05-17 16:23 -0500

csiph-web