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

Use fmt library for string formatting #1396

Merged
merged 1 commit into from
Oct 18, 2024
Merged

Use fmt library for string formatting #1396

merged 1 commit into from
Oct 18, 2024

Conversation

f0reachARR
Copy link
Contributor

Description

Abstract

In this PR, I will introduce fmt formatting library instead.
This will make JSON serialization faster.

Background

Currently, we use stringstream to format string, which is used to be a part of Context JSON.
However, stringstream is known as "slower" implementation, and this is one of bottleneck in JSON serialization.

image
Cite from fmt

Copy link

Checklist for reviewers ☑️

All references to "You" in the following text refer to the code reviewer.

  • Is this pull request written in a way that is easy to read from a third-party perspective?
  • Is there sufficient information (background, purpose, specification, algorithm description, list of disruptive changes, and migration guide) in the description of this pull request?
  • If this pull request contains a destructive change, does this pull request contain the migration guide?
  • Labels of this pull request are valid?
  • All unit tests/integration tests are included in this pull request? If you think adding test cases is unnecessary, please describe why and cross out this line.
  • The documentation for this pull request is enough? If you think adding documents for this pull request is unnecessary, please describe why and cross out this line.

@f0reachARR f0reachARR self-assigned this Oct 1, 2024
@f0reachARR
Copy link
Contributor Author

In some my experiments, stringstream is faster than fmt. I think something is strange.
I will investigate it.

@HansRobo HansRobo merged commit 6017248 into master Oct 18, 2024
10 of 11 checks passed
@HansRobo
Copy link
Member

This is marked as merged because all commits are included in #1418

@HansRobo HansRobo deleted the feature/fmt branch October 18, 2024 02:33
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