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

server: uniform whitespace handling in rpc calls #1082

Merged
merged 9 commits into from
Apr 17, 2023

Conversation

niklasad1
Copy link
Member

Builds on #1080

We are already throwing away calls that begins with more than 127 whitespace characters in the HTTP server so let's do the same for the WS part as well.

In addition as we already know how many whitespace characters to skip these bytes are not needed and might speed up deserialization.

@niklasad1 niklasad1 requested a review from a team as a code owner April 14, 2023 13:31
@niklasad1
Copy link
Member Author

benches with 10 000 starting whitespaces.

jsonrpsee_types_deserialize_whitespace
                        time:   [4.6532 µs 4.6558 µs 4.6589 µs]
                        change: [+0.6001% +0.6798% +0.7723%] (p = 0.00 < 0.05)
                        Change within noise threshold.
Found 15 outliers among 100 measurements (15.00%)
  9 (9.00%) high mild
  6 (6.00%) high severe

jsonrpsee_types_deserialize_manually_strip_whitespace
                        time:   [3.5121 µs 3.5161 µs 3.5211 µs]
                        change: [-23.348% -23.257% -23.160%] (p = 0.00 < 0.05)
                        Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
  7 (7.00%) high mild
  2 (2.00%) high severe

jsonrpsee_types_deserialize_manually_strip_whitespace_but_deserialize_entire_payload
                        time:   [8.3066 µs 8.3898 µs 8.4791 µs]
Found 26 outliers among 100 measurements (26.00%)
  13 (13.00%) low severe
  10 (10.00%) high mild
  3 (3.00%) high severe

Thus, indeed this a perf improvement

@niklasad1 niklasad1 changed the title server: uniform whitespace handling in requests server: uniform whitespace handling in rpc calls Apr 17, 2023
@niklasad1 niklasad1 mentioned this pull request Apr 17, 2023
@niklasad1 niklasad1 merged commit 7364c02 into master Apr 17, 2023
8 checks passed
@niklasad1 niklasad1 deleted the na-ws-server-uniform-whitespace-handling branch April 17, 2023 14:17
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.

None yet

3 participants