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

Added more bench #405

Merged
merged 1 commit into from
Jan 3, 2021
Merged

Conversation

barambani
Copy link
Member

@barambani barambani commented Jan 3, 2021

This adds details to the benchmarks. This is a decently long run of them

Warm up: 100
Run: 80

Benchmark                                               Mode  Cnt      Score     Error  Units
LaserdiscCatsBench.parallelLoad1                       thrpt   80   3349.437 ±   8.282  ops/s
LaserdiscCatsBench.parallelLoad2                       thrpt   80  11258.697 ±  41.626  ops/s

LaserdiscCatsByteInByteOutBaselineBench.parallelLoad1  thrpt   80  34708.101 ± 179.938  ops/s
LaserdiscCatsByteInByteOutBaselineBench.parallelLoad2  thrpt   80  37199.185 ± 212.584  ops/s
LaserdiscCatsByteInBitVectorOutBench.parallelLoad1     thrpt   80  34943.358 ± 367.778  ops/s
LaserdiscCatsByteInBitVectorOutBench.parallelLoad2     thrpt   80  37519.965 ± 226.816  ops/s
LaserdiscCatsByteInRespOutBench.parallelLoad1          thrpt   80  34463.531 ± 187.946  ops/s
LaserdiscCatsByteInRespOutBench.parallelLoad2          thrpt   80  37237.865 ± 209.944  ops/s

LaserdiscCatsBitVectorInByteOutBench.parallelLoad1     thrpt   80  10768.768 ±  27.611  ops/s
LaserdiscCatsBitVectorInByteOutBench.parallelLoad2     thrpt   80  26825.166 ± 117.870  ops/s
LaserdiscCatsBitVectorInAndOutBench.parallelLoad1      thrpt   80  10806.238 ±  29.071  ops/s
LaserdiscCatsBitVectorInAndOutBench.parallelLoad2      thrpt   80  26877.197 ± 104.289  ops/s
LaserdiscCatsBitVectorInRespOutBench.parallelLoad1     thrpt   80  10844.652 ±  23.217  ops/s
LaserdiscCatsBitVectorInRespOutBench.parallelLoad2     thrpt   80  26797.135 ± 116.742  ops/s

LaserdiscCatsRespInByteOutBench.parallelLoad1          thrpt   80   5685.825 ± 216.942  ops/s
LaserdiscCatsRespInByteOutBench.parallelLoad2          thrpt   80   9344.706 ±  89.726  ops/s
LaserdiscCatsRespInBitVectorOutBench.parallelLoad1     thrpt   80   5776.950 ±  58.856  ops/s
LaserdiscCatsRespInBitVectorOutBench.parallelLoad2     thrpt   80   9100.154 ± 104.500  ops/s
LaserdiscCatsRespInAndOutBench.parallelLoad1           thrpt   80   5708.616 ±  99.559  ops/s
LaserdiscCatsRespInAndOutBench.parallelLoad2           thrpt   80   8558.018 ±  72.819  ops/s

---------------------------------------------------------------------------------------------
RedisForCatsBench.parallelLoad1                        thrpt   80  34424.303 ±  29.940  ops/s
RedisForCatsBench.parallelLoad2                        thrpt   80  73464.070 ± 539.231  ops/s

it seems that converting to bit vector or decoding response messages doesn't add much, so the bottleneck must be somewhere else (I guess in fs2.io that's much slower than that). What seems to cost is the send. Every stage adds a bit.
I haven't tried to speed up things, anyway considering that our baseline is much slower than other clients I would say we stop here the effort for performances and we see how other client designs look like.

@@ -41,12 +39,10 @@ private[laserdisc] final case class CompleteFrame(bits: BitVector) extends NonEm
private[laserdisc] final case class MoreThanOneFrame(private[laserdisc] val complete: Vector[CompleteFrame], remainder: BitVector)
extends NonEmptyRESPFrame
private[laserdisc] final case class IncompleteFrame(partial: BitVector, bitsToComplete: Long) extends NonEmptyRESPFrame {
override def append(bytes: ByteBuffer): Exception | NonEmptyRESPFrame = {
val newBits = BitVector.view(bytes)
override def append(bits: BitVector): Exception | NonEmptyRESPFrame =
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here's the only real change to production code, and it's more a clean up of unneeded conversions than a performance improvement.

@barambani barambani changed the title Added more bnech Added more bench Jan 3, 2021
@codecov-io
Copy link

codecov-io commented Jan 3, 2021

Codecov Report

Merging #405 (4c65507) into master (4b6cc69) will decrease coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #405      +/-   ##
==========================================
- Coverage   62.84%   62.81%   -0.03%     
==========================================
  Files          38       38              
  Lines        1281     1280       -1     
  Branches        8        8              
==========================================
- Hits          805      804       -1     
  Misses        476      476              
Impacted Files Coverage Δ
.../src/main/scala/laserdisc/protocol/RESPFrame.scala 92.85% <100.00%> (-0.48%) ⬇️
...s2/src/main/scala/laserdisc/fs2/RedisChannel.scala 76.19% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4b6cc69...4c65507. Read the comment docs.

@barambani barambani merged commit 875931f into laserdisc-io:master Jan 3, 2021
@barambani barambani deleted the more-resp-bench branch January 3, 2021 14:26
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.

3 participants