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

airframe-codec: 3-5x Improvement of the codec lookup performance of MessageCodecFactory #2961

Merged
merged 2 commits into from
May 16, 2023

Conversation

xerial
Copy link
Member

@xerial xerial commented May 16, 2023

MessageCodecFactory used Surface case class as a cache key, which had a significant overhead. Improved the performance by using Surface.fullName as a cache key:

Before

[info] Benchmark                                     Mode  Cnt          Score          Error  Units
[info] RPCRequestBenchmark.rpcBodyOnly              thrpt   10  143043471.699 ± 72497486.069  ops/s
[info] RPCRequestBenchmark.rpcRequestNoCodec        thrpt   10      89063.233 ±      624.039  ops/s
[info] RPCRequestBenchmark.rpcRequestWithJsonSer    thrpt   10      74278.516 ±     1438.154  ops/s
[info] RPCRequestBenchmark.rpcRequestWithRPCMethod  thrpt   10      58004.750 ±      984.233  ops/s

After

[info] Benchmark                                     Mode  Cnt          Score        Error  Units
[info] RPCRequestBenchmark.rpcBodyOnly              thrpt   10  186913889.715 ± 966841.794  ops/s
[info] RPCRequestBenchmark.rpcRequestNoCodec        thrpt   10     346416.119 ±   4292.134  ops/s
[info] RPCRequestBenchmark.rpcRequestWithJsonSer    thrpt   10     204541.213 ±   3527.284  ops/s
[info] RPCRequestBenchmark.rpcRequestWithRPCMethod  thrpt   10     299616.662 ±   1119.058  ops/s

@github-actions github-actions bot added the internal Internal changes (usually non-user facing) label May 16, 2023
@xerial xerial added feature and removed internal Internal changes (usually non-user facing) labels May 16, 2023
@xerial xerial changed the title internal: Initialize codec to reduce the serde overhead airframe-codec: 3-5x Improvement of the codec lookup performance of MessageCodecFactory May 16, 2023
@xerial xerial enabled auto-merge (squash) May 16, 2023 23:29
@codecov
Copy link

codecov bot commented May 16, 2023

Codecov Report

Merging #2961 (2aad7c8) into master (3d16816) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2961   +/-   ##
=======================================
  Coverage   82.85%   82.86%           
=======================================
  Files         348      348           
  Lines       14591    14592    +1     
  Branches     2384     2397   +13     
=======================================
+ Hits        12090    12091    +1     
  Misses       2501     2501           
Impacted Files Coverage Δ
...ala/wvlet/airframe/codec/MessageCodecFactory.scala 86.20% <100.00%> (+0.49%) ⬆️

Continue to review full report in Codecov by Sentry.

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

@xerial xerial merged commit 2425f74 into master May 16, 2023
@xerial xerial deleted the bench-add branch May 16, 2023 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant