+
Skip to content

Conversation

shawjef3
Copy link
Contributor

@shawjef3 shawjef3 commented Oct 6, 2022

Inspired by #7396 .

The nonempty case is a little slower. The empty case is a lot faster. I'm unsure if the tradeoff is worth it, but I had this idea and wanted to present it.

Before

[info] Benchmark                                      (size)   Mode  Cnt          Score         Error  Units
[info] ChunkConcatBenchmarks.balancedConcatOnce        10000  thrpt   10  203992533.765 ± 2075468.906  ops/s
[info] ChunkConcatBenchmarks.balancedConcatRecursive   10000  thrpt   10      18370.965 ±      41.063  ops/s
[info] ChunkConcatBenchmarks.leftConcat0               10000  thrpt   10       1509.055 ±       8.703  ops/s
[info] ChunkConcatBenchmarks.leftConcat1               10000  thrpt   10       1516.642 ±      13.518  ops/s
[info] ChunkConcatBenchmarks.leftConcat10              10000  thrpt   10      21650.274 ±     162.907  ops/s
[info] ChunkConcatBenchmarks.rightConcat0              10000  thrpt   10       1456.520 ±      12.798  ops/s
[info] ChunkConcatBenchmarks.rightConcat1              10000  thrpt   10       1497.503 ±      15.500  ops/s
[info] ChunkConcatBenchmarks.rightConcat10             10000  thrpt   10      20575.558 ±     203.644  ops/s

After

[info] Benchmark                                      (size)   Mode  Cnt          Score         Error  Units
[info] ChunkConcatBenchmarks.balancedConcatOnce        10000  thrpt   10  206777416.179 ± 1702134.374  ops/s
[info] ChunkConcatBenchmarks.balancedConcatRecursive   10000  thrpt   10      17183.683 ±     203.886  ops/s
[info] ChunkConcatBenchmarks.leftConcat0               10000  thrpt   10      75478.279 ±     542.242  ops/s
[info] ChunkConcatBenchmarks.leftConcat1               10000  thrpt   10       1373.804 ±      96.077  ops/s
[info] ChunkConcatBenchmarks.leftConcat10              10000  thrpt   10      19332.971 ±     149.147  ops/s
[info] ChunkConcatBenchmarks.rightConcat0              10000  thrpt   10      67146.335 ±     509.862  ops/s
[info] ChunkConcatBenchmarks.rightConcat1              10000  thrpt   10       1336.395 ±      10.295  ops/s
[info] ChunkConcatBenchmarks.rightConcat10             10000  thrpt   10      19059.703 ±     131.697  ops/s

@adamgfraser adamgfraser merged commit 61b4933 into zio:series/1.x Oct 6, 2022
adamgfraser pushed a commit that referenced this pull request Oct 17, 2022
* Fix Gen.instant (#7325)

* Make concatenation of empty chunks 600 times faster (#7396)

* Extend benchmark coverage of Chunk concatenation

* Improve performance of concatenation of empty Chunks

* replace unused identifier with _

* Improve Chunk concatenation performance when either chunk is empty. (#7399)

* Update things for Scala Native (still no running tests) (#7409)

* Scala Native: run tests

* Native: Run scala-native-loop in OneShot#get

* Native: Test / fork := false

* ci.yaml: testPlatforms on Scala 3

* ci.yaml: testPlatforms 180 min timeout

* ci.yaml: testPlatforms 360 min timeout

* ci.yaml: testPlatforms on Scala 3

* Update versions

* Update versions

* Update munit

* Update things for Scala Native (still no running tests)

* Update

* Scala 2.12.16, 2.13.8

* fix merge

Co-authored-by: LUC DUZAN <strokyl@users.noreply.github.com>
Co-authored-by: Rafał Sumisławski <rafal.sumislawski@gmail.com>
Co-authored-by: shawjef3 <shawjef3@gmail.com>
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.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载