Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

performance improvement pg_copy_to_string - change the way concat string #8

Merged
merged 1 commit into from Apr 4, 2013

Conversation

Projects
None yet
2 participants

ermolaev commented Apr 4, 2013

require 'benchmark'

Benchmark.bm do |b| 
  b.report('+=') do
    data = ''
    line = 'hello word'

    100_000.times { data += line}
  end

  b.report('<<') do
    data = ''
    line = 'hello word'

    100_000.times { data << line}
  end

end
       user     system      total        real
+=  8.750000  13.420000  22.170000 ( 22.236511)
<<  0.010000   0.000000   0.010000 (  0.014012)

diogob added a commit that referenced this pull request Apr 4, 2013

Merge pull request #8 from ermolaev/master
performance improvement pg_copy_to_string - change the way concat string

@diogob diogob merged commit 66c159d into diogob:master Apr 4, 2013

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment