Sha256: 9b7c683ff235e2053068201aa66da5dc1b87734c4bc8dbca9a874571106055b4
Contents?: true
Size: 406 Bytes
Versions: 10
Compression:
Stored size: 406 Bytes
Contents
require 'benchmark' #require 'pathname' require 'mega/pathname' $f1 = "a/b/c" $f2 = "d/e/f" $p1 = Pathname.new($f1) $p2 = Pathname.new($f2) def file_join File.join( $f1 , $f2 ) end def path_join $p1 + $p2 end n = 50000 Benchmark.bm(7) do |x| x.report("path-join") { n.times do ; path_join ; end } x.report("file-join") { n.times do ; file_join ; end } end
Version data entries
10 entries across 10 versions & 1 rubygems