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

perf: use switch to detect method #5413

Closed
wants to merge 4 commits into from

Conversation

gurgunday
Copy link
Member

@gurgunday gurgunday commented Apr 21, 2024

As more methods are added, the difference should get more significant

Also switch is more readable in my opinion

@gurgunday gurgunday added the benchmark Label to run benchmark against PR and main branch label Apr 21, 2024
@gurgunday
Copy link
Member Author

The benchmark label seems broken

@gurgunday gurgunday removed the benchmark Label to run benchmark against PR and main branch label Apr 21, 2024
@gurgunday gurgunday added the benchmark Label to run benchmark against PR and main branch label Apr 21, 2024
Copy link

Node: 16
PR: [1] 1746k requests in 30.04s, 328 MB read
MAIN: [1] 1758k requests in 30.05s, 330 MB read


Node: 18
PR: [1] 1537k requests in 30.04s, 289 MB read
MAIN: [1] 1501k requests in 30.04s, 282 MB read


Node: 20
PR: [1] 1516k requests in 30.05s, 285 MB read
MAIN: [1] 1450k requests in 30.05s, 272 MB read

Copy link

Node: 16
PR: [1] 1570k requests in 30.04s, 295 MB read
MAIN: [1] 1568k requests in 30.04s, 295 MB read


Node: 18
PR: [1] 1360k requests in 30.04s, 256 MB read
MAIN: [1] 1340k requests in 30.04s, 252 MB read


Node: 20
PR: [1] 1481k requests in 30.05s, 278 MB read
MAIN: [1] 1441k requests in 30.04s, 271 MB read

@gurgunday gurgunday removed the benchmark Label to run benchmark against PR and main branch label Apr 21, 2024
@gurgunday
Copy link
Member Author

Second one is slightly more relevant as it tests contentType parsers and mainly uses 'POST' instead of 'GET'

GET gets matched immediately in both cases so it's not very useful

@gurgunday gurgunday added the benchmark Label to run benchmark against PR and main branch label Apr 21, 2024
Copy link

Node: 16
PR: [1] 1768k requests in 30.04s, 332 MB read
MAIN: [1] 1785k requests in 30.04s, 335 MB read


Node: 18
PR: [1] 1526k requests in 30.04s, 287 MB read
MAIN: [1] 1522k requests in 30.04s, 286 MB read


Node: 20
PR: [1] 1559k requests in 30.04s, 293 MB read
MAIN: [1] 1561k requests in 30.04s, 293 MB read

Copy link

Node: 16
PR: [1] 1442k requests in 30.04s, 271 MB read
MAIN: [1] 1491k requests in 30.04s, 280 MB read


Node: 18
PR: [1] 1377k requests in 30.04s, 259 MB read
MAIN: [1] 1356k requests in 30.04s, 255 MB read


Node: 20
PR: [1] 1332k requests in 30.05s, 250 MB read
MAIN: [1] 1274k requests in 30.04s, 239 MB read

@github-actions github-actions bot removed the benchmark Label to run benchmark against PR and main branch label Apr 21, 2024
@gurgunday gurgunday marked this pull request as draft April 21, 2024 22:14
@gurgunday
Copy link
Member Author

This won't be needed after #5419

@gurgunday gurgunday closed this Apr 22, 2024
@gurgunday gurgunday deleted the switch-content-type branch April 22, 2024 10:54
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

1 participant