The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Yet another YARV Bm

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Corvus Corvidae

Posts: 12
Nickname: corvidae
Registered: Feb, 2006

Corvus Corvidae is not dead
Yet another YARV Bm Posted: Feb 17, 2006 2:54 AM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Corvus Corvidae.
Original Post: Yet another YARV Bm
Feed Title: corvidae_rb
Feed URL: http://corvidae-rb.livejournal.com/data/rss
Feed Description: corvidae_rb - LiveJournal.com
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Corvus Corvidae
Latest Posts From corvidae_rb

Advertisement
One of the few disappointing benchmarks. The intent is to be an example of simple line-oriented reading/processing, not to be the fastest example of a wc-like program:
  $ cat wc.rb 
  nwords, nbytes,nlines = 0,0,0
  ARGF.each do |line|
    words = line.split
    nwords += words.length
    nbytes += line.length
    nlines += 1
  end
  printf "%7d %7d %7d total\n", nlines, nwords, nbytes;
  __END__

  $ ruby -v
  ruby 1.8.4 (2006-02-01) [i686-linux]

  $ ./yarv -v
  ruby 1.9.0 (2005-11-18) [i686-linux]
  YARVCore 0.3.3 (rev: 366) [opts: ]

  $ time ruby wc.rb ../../Tdata/large.txt 
   208048 1675832 11021496 total

  real    0m9.293s
  user    0m9.090s
  sys     0m0.130s

  $ time ./yarv  wc.rb ../../Tdata/large.txt 
   208048 1675832 11021496 total

  real    0m13.671s
  user    0m13.350s
  sys     0m0.230s
So, in this application yarv is a little slower. Further investigation (commenting out lines in the loop) show that yarv is a little slower on both reading and splitting. Too bad, as those are pretty common operations. On the other hand, yarv is young yet.

Read: Yet another YARV Bm

Topic: Another 150 RailsConf Seats Previous Topic   Next Topic Topic: It's A Small Semantic World

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use