-
Notifications
You must be signed in to change notification settings - Fork 5.3k
improve performance of json formatter #35501
Copy link
Copy link
Closed
Labels
area/perfenhancementFeature requests. Not bugs or questions.Feature requests. Not bugs or questions.no stalebotDisables stalebot from closing an issueDisables stalebot from closing an issue
Description
Title: improve performance of json formatter
Description:
See the performance result:
---------------------------------------------------------------------------
Benchmark Time CPU Iterations
---------------------------------------------------------------------------
BM_AccessLogFormatterSetup 8899 ns 8851 ns 78731
BM_AccessLogFormatter 486 ns 485 ns 1452972
BM_StructAccessLogFormatter 7433 ns 7423 ns 92404
BM_TypedStructAccessLogFormatter 5459 ns 5394 ns 124266
BM_JsonAccessLogFormatter 12378 ns 12364 ns 52029
BM_TypedJsonAccessLogFormatter 11297 ns 11282 ns 65591
BM_FormatterCommandParsing 40.5 ns 40.5 ns 17290397
The json formatter takes 20+x overhead rather than text formatter. What can I say? I always know it is slow, but I don't know it's so slow.
[optional Relevant Links:]
Any extra documentation required to understand the issue.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area/perfenhancementFeature requests. Not bugs or questions.Feature requests. Not bugs or questions.no stalebotDisables stalebot from closing an issueDisables stalebot from closing an issue