String concat contains dummy comparision.
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 35/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- ruby
- 領域
- performance
調査の方向性
issue に記載されている String concatenation ベンチマークをリポジトリ内で探し、現在の設定と報告されているケースを確認します。ベンチマークを更新して、ランダム化された文字列長と複数文字列の連結を対象にし、その後、結果を issue の例と比較して、固定入力による誤解を招く比較が解消されたことを確認します。
索引モデルが issue の本文から書いたものです。
説明
You are doing your test without any randomization and length variety, so results are incorrect completely.
You simply just testing how fast are 'foo' and 'bar' concatenation, and only
Live case scenario looks more like this:
# strings length is a ( 100 + rand( 100 ) ), i.e. short strings max difference around double
String#append: 439150.7 i/s
String#+: 419672.1 i/s - same-ish: difference falls within error
"#{'foo'}#{'bar'}": 365799.6 i/s - 1.20x slower
String#concat: 353912.5 i/s - 1.24x slower
# strings length is a (1000 + rand( 1000) ) , i.e. longer strings max difference around double
String#+: 298633.5 i/s
String#append: 284566.8 i/s - same-ish: difference falls within error
"#{'foo'}#{'bar'}": 267548.4 i/s - 1.12x slower
String#concat: 215419.4 i/s - 1.39x slower
# string length is a ( 100 + rand(1000) ), i.e. highly variable length
String#+: 388205.2 i/s
String#append: 357669.3 i/s - 1.09x slower
"#{'foo'}#{'bar'}": 331617.7 i/s - 1.17x slower
String#concat: 286717.8 i/s - 1.35x slower
# string length is a 1 + rand 1000, i.e. random string
String#+: 385180.8 i/s
String#append: 373926.8 i/s - same-ish: difference falls within error
"#{'foo'}#{'bar'}": 341496.6 i/s - 1.13x slower
String#concat: 297988.1 i/s - 1.29x slower
OK
# This is completely oposite to
"foo" "bar": 5369594.5 i/s
"#{'foo'}#{'bar'}": 5181745.7 i/s - same-ish: difference falls within error
String#append: 3075719.2 i/s - 1.75x slower
String#concat: 3016703.5 i/s - 1.78x slower
String#+: 2977282.7 i/s - 1.80x slower
Also you didn't test on multiple string concat, where actually "#{'foo'} #{'bar'} #{'shines'}".
- 主要言語
- Ruby
- スター
- 5.7k
- フォーク
- 370
- PR マージ指標
- 30日以内にマージされた PR はありません
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fastruby/fast-ruby のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 52/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 32/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 42/100
fastruby/fast-ruby の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
TheOdinProject/curriculum#31417 · コメント 2 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
glossarist/glossarist-ruby#238 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
palladius/rails8-app-on-gcp#145 ·