-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Implement unmarshal traces with jsoniter, make 35x faster than jsonpb(#4817) #4986
Implement unmarshal traces with jsoniter, make 35x faster than jsonpb(#4817) #4986
Conversation
bfa3fcd
to
6ff4ba6
Compare
Codecov Report
@@ Coverage Diff @@
## main #4986 +/- ##
==========================================
+ Coverage 90.53% 90.76% +0.22%
==========================================
Files 190 190
Lines 11111 11407 +296
==========================================
+ Hits 10059 10353 +294
- Misses 829 833 +4
+ Partials 223 221 -2
Continue to review full report at Codecov.
|
f4bfa8b
to
0ec4ace
Compare
0ec4ace
to
a47dea8
Compare
We try to discourage JSON usage because of performance impact in general anyway. What is the use case for using JSON instead of proto encoded? |
Yes, I know JSON performance is lower than proto, but in some use case, JSON is more friendly to frontend(web/mobile) or Lua script runtime to report telemetry data. protobuf has extra generated code dependency. I add a benchmark compare to jsoniter vs protobuf. jsoniter is only 2.x slower pb. a lot of improvements compare to jsonpb.
|
f745892
to
c205561
Compare
01dbf3e
to
c568091
Compare
@hanjm sorry for the wait. I am waiting for the pdata split to finish first before making more changes in that package. |
Please rebase. |
31effc1
to
e6d317e
Compare
Rebase Done.
|
contrib-tests failure is expected. It will be fixed once open-telemetry/opentelemetry-collector-contrib#9389 is merged |
e6d317e
to
f954620
Compare
@bogdandrutu Rebase done, Please help review, thank you. |
d68f650
to
ac572a4
Compare
Update unit test style design.
ac572a4
to
8ece8e7
Compare
Description:
As the #4817 and the trace proto are stable, I implement unmarshal traces with
jsoniter
iterator parser, compare withjsonpb
unmarshaller,jsoniter
does not use reflect, more efficient, less GC pressure.The benchmark results show 35x faster, 5x fewer allocs, 19x fewer alloc bytes.
If it is acceptable. i think we can make JSON unmarshaller is configurable,
jsonpb
is default,jsoniter
is optional.I want to split the full function into a series of small PR:
otlpreceiver
support configjsoniter
as optional unmarshaller.Link to tracking Issue:
#4817
Testing: < Describe what testing was performed and which tests were added.>