benchmark-driver.github.io This website has moved to: rubybench.github.io.
Nothing presents performance statistics quite as well as having graphs for benchmarks. Whether you want to present an alternative way for code guidelines based on performance or show a presentation, seeing the difference makes a difference. What we'll cover here will show you how to generate graph data images from your own Ruby codebase's benchmark suite, with presentation-worthy quality. The benc
はじめに JuanitoFatas/fast-rubyにRubyの役割の似たメソッドのパフォーマンスがまとまっていたが、結果だけでなくコードも並べて一覧化したかったので、当該リポジトリをcloneしてきて、以下のscriptを実行してまとめなおした。 File.open('./result.md', 'w') do |dest| $stdout = dest Dir.glob('code/**/*rb').each do |f| dest.puts "## #{File.basename(f, '.rb')}" dest.puts "\`\`\`rb" dest.puts File.open(f).read dest.puts "\`\`\`" dest.puts dest.puts "\`\`\`" require "./#{f}" dest.puts "\`\`\`" dest.put
Test suites like this are generally hard on optimizing runtimes. They always start in a cold state, they run for a short period of time, and in the case of JVM-based languages they incur a high degree of overhead when spawning new processes. For this test suite, which has 2,121 specs and 3,824 assertions, TruffleRuby on the SVM is 6.6 times faster than TruffleRuby on the JVM, shaving almost a full
Thoughts on different Ruby implementations Let’s wrap this up with a couple of thoughts on the different implementations: TruffleRuby TruffleRuby is making steady and great progress, which I’m thoroughly impressed with. To be honest, I was wondering if its performance increased since the last benchmark as I was worried that implementing new Ruby features would lead to decreased performance. Seeing
Matz も驚く Crystal これ、Rubyでもそのまま動くんじゃないか? Crystalすげーっ。 https://t.co/pO0F0vqTly — Yukihiro Matsumoto (@yukihiro_matz) June 16, 2015 Crystal Language Goals Ruby-inspired syntax. Statically type-checked but without having to specify the type ... http://crystal-lang.org/ ruby と殆ど同じシンタックスが通る様です。 # A very basic HTTP server require "http/server" server = HTTP::Server.new(8080) do |request| HTTP::Response.o
Comparing ancestry and closure_tree for your nested data structure Sun, Sep 13, 2015 When it comes to implementing ActiveRecord nesting, there are a few popular implementations. In this post I will look closer at how Ancestry and Closure tree work and what the pros and cons are. How ancestry works Ancestry works by adding one column (by default named “ancestry”) that replaces the parent_id. Instea
先日の find_allのindex版( http://qiita.com/pocari/items/0b4e632ef2a2b6a97ba9 )という記事を受けて。 ruby 1.9 ruby 2.0 ruby 2.1 jruby1.7.12 --1.9 jruby1.7.12 --2.0 の5つの環境で速度がどう変わるか調べてみたよ。 わかったこと ※ すべて、今回のベンチマークの範囲の話。一般的かどうかはわからない。 each_with_index.select や flat_map.with_index は、ruby 1.9 → 2.0 → 2.1 と、すごく速くなっている。都合 10倍以上。 CRuby だと、each_with_index と each.with_index は、同じっぽい。 JRuby だと、each_with_index より each.with_index
vs 1 : Are the Ruby JRuby programs faster? At a glance. Each chart bar shows, for one unidentified benchmark, how much the fastest Ruby JRuby program used compared to the fastest Ruby 2.0 program. These are not the only compilers and interpreters. These are not the only programs that could be written. These are not the only tasks that could be solved. These are just 10 tiny examples. 2 : Are the
Rubyいつも書き方を忘れるyield、block.call、proc、lambda。自分が使うのはeachで回したい時がほとんどなので、その書き方をまとめておく。これを見れば使い方も何となくわかるはずだ。ついでにベンチーマークも用意してみた。 # -*- coding: utf-8 -*- require 'benchmark' num = ARGV[0].to_i # yield 1 def test1(arr, &block) if block_given? arr.each {|d| yield(d) } end end # yield 2 def test2(arr, &block) arr.each do |d| yield(d) if block_given? end end # block.call 1 def test3(arr, &block) if block_giv
What are the behavioural differences between the following two implementations in Ruby of the thrice method? module WithYield def self.thrice 3.times { yield } # yield to the implicit block argument end end module WithProcCall def self.thrice(&block) # & converts implicit block to an explicit, named Proc 3.times { block.call } # invoke Proc#call end end WithYield::thrice { puts "Hello world" } Wit
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く