Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parser_none: Use faster record creation #2455

Merged
merged 1 commit into from
Jun 13, 2019
Merged

Conversation

repeatedly
Copy link
Member

Signed-off-by: Masahiro Nakagawa repeatedly@gmail.com

Which issue(s) this PR fixes:
None

What this PR does / why we need it:
I found current implementation is bit slower,

require 'benchmark/ips'

key = 'message'
value = 'loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong'

Benchmark.ips do |x|
  x.report "init" do
    r = {key => value}
  end

  x.report "init + []=" do
    r = {}
    r[key] = value
  end
end
Warming up --------------------------------------
                init   250.160k i/100ms
          init + []=   243.042k i/100ms
Calculating -------------------------------------
                init      5.944M (± 1.9%) i/s -     29.769M in   5.010006s
          init + []=      5.508M (± 1.2%) i/s -     27.707M in   5.031503s

Docs Changes:
No need.

Release Note:
Same title

Signed-off-by: Masahiro Nakagawa <repeatedly@gmail.com>
@repeatedly repeatedly added the enhancement Feature request or improve operations label Jun 13, 2019
@repeatedly repeatedly requested a review from ganmacs June 13, 2019 05:11
@repeatedly repeatedly merged commit 0cfb8ad into master Jun 13, 2019
@repeatedly repeatedly deleted the parser-none-small-opt branch June 13, 2019 12:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature request or improve operations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants