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

[Experiment] Re-write in Ruby #175

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft

[Experiment] Re-write in Ruby #175

wants to merge 6 commits into from

Conversation

yosiat
Copy link
Owner

@yosiat yosiat commented Oct 20, 2024

No description provided.

@yosiat
Copy link
Owner Author

yosiat commented Oct 24, 2024

Current benchmark results (Ruby 3.3.4, with YJIT):

Version 7.0

Benchmark Master IP/s Ruby Impl IP/s Speedup %
Panko_Simple_Posts_1 377,479.15 338,265.34 -10.37%
Panko_Simple_Posts_50 24,939.69 24,177.99 -3.05%
Panko_Simple_Posts_2300 563.88 545.45 -3.27%
Panko_HasOne_Posts_1 235,321.49 198,602.78 -15.57%
Panko_HasOne_Posts_50 14,561.39 13,994.49 -3.89%
Panko_HasOne_Posts_2300 322.77 299.51 -7.23%
Panko_SimpleWithMethodCall_Posts_1 330,799.99 257,459.93 -22.17%
Panko_SimpleWithMethodCall_Posts_50 21,179.01 18,404.41 -13.10%
Panko_SimpleWithMethodCall_Posts_2300 470.75 414.86 -11.86%

Version 7.1

Benchmark Master IP/s Ruby Impl IP/s Speedup %
Panko_Simple_Posts_1 369,823.87 305,030.43 -17.52%
Panko_Simple_Posts_50 24,977.47 23,634.88 -5.38%
Panko_Simple_Posts_2300 565.92 537.40 -5.04%
Panko_HasOne_Posts_1 231,484.99 198,536.51 -14.24%
Panko_HasOne_Posts_50 14,619.77 13,300.63 -9.03%
Panko_HasOne_Posts_2300 319.30 293.88 -7.97%
Panko_SimpleWithMethodCall_Posts_1 323,965.38 259,798.66 -19.78%
Panko_SimpleWithMethodCall_Posts_50 21,135.37 18,025.87 -14.72%
Panko_SimpleWithMethodCall_Posts_2300 475.02 407.70 -14.16%

Version 7.2

Benchmark Master IP/s Ruby Impl IP/s Speedup %
Panko_Simple_Posts_1 382,297.52 304,755.42 -20.29%
Panko_Simple_Posts_50 24,947.58 23,883.20 -4.26%
Panko_Simple_Posts_2300 560.80 543.03 -3.17%
Panko_HasOne_Posts_1 239,425.73 197,309.56 -17.58%
Panko_HasOne_Posts_50 15,161.13 14,335.16 -5.45%
Panko_HasOne_Posts_2300 333.34 308.64 -7.41%
Panko_SimpleWithMethodCall_Posts_1 323,096.70 254,815.05 -21.12%
Panko_SimpleWithMethodCall_Posts_50 21,114.07 18,245.98 -13.58%
Panko_SimpleWithMethodCall_Posts_2300 472.90 410.74 -13.13%

Version 8.0.0

Benchmark Master IP/s Ruby Impl IP/s Speedup %
Panko_Simple_Posts_1 371,077.45 293,522.35 -20.90%
Panko_Simple_Posts_50 24,130.60 22,416.56 -7.10%
Panko_Simple_Posts_2300 543.94 510.40 -6.17%
Panko_HasOne_Posts_1 234,945.45 187,498.68 -20.21%
Panko_HasOne_Posts_50 14,508.65 13,398.18 -7.66%
Panko_HasOne_Posts_2300 319.56 287.41 -10.07%
Panko_SimpleWithMethodCall_Posts_1 329,574.75 239,702.82 -27.25%
Panko_SimpleWithMethodCall_Posts_50 20,482.52 16,914.82 -17.38%
Panko_SimpleWithMethodCall_Posts_2300 459.90 382.91 -16.74%

@yosiat yosiat mentioned this pull request Nov 2, 2024
@yosiat yosiat force-pushed the ruby-impl branch 3 times, most recently from a243188 to 817c1d5 Compare November 2, 2024 13:03
@yosiat yosiat force-pushed the ruby-impl branch 3 times, most recently from 660fe3a to a0584ce Compare November 2, 2024 13:08
Oj converts the string to UTF8 which inccurs in performance cost.
Given that input string is UTF8, this code should be correct.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant