Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
March 11, 2021 12:10 pm GMT

How urls change performance with frameworks and raw http package in node.js?

I was told that raw http package is much faster than the frameworks. But I don't really trust such claims.
So I make a test on how performance changes on http raw packages and frameworks.
Here is the test code, so you can get your own result.

You will see, in my test, as the url getting complicated, the performance difference is getting smaller.

The detailed result is as follows:

Node.js framework Benchmarks

root url "/"

http(raw)aexexpresskoa
5683.824463.534058.925042.28
5742.874414.534055.425293.72
5688.204547.683743.785309.73
5896.434332.363913.135255.86
5917.574104.714058.255280.56
6026.364303.744085.235333.55
5771.184349.194027.745245.15

the averaged results:

http(raw)aexexpresskoa
5818.064359.393991.785251.55

visual differences:

root url

none root url access "/url"

http(raw)aexexpresskoa
5987.784062.693636.434375.62
5941.464065.193677.684498.54
5973.594041.633564.664307.33
5942.724075.493429.734427.29
5970.654072.763508.854274.21
5930.924046.413534.674452.34

the averaged results:

http(raw)aexexpresskoa
5957.854060.703558.674389.22

visual differences:

none root url

parameterized url "/user/:id"

http(raw)aexexpresskoa
5177.354366.733655.534703.51
4935.864290.903722.144811.56
5175.584326.333704.044667.66
5183.804340.193787.274899.29
5188.294362.573797.094896.09
5322.294359.823794.244718.80

the averaged results:

http(raw)aexexpresskoa
5163.864341.093743.394782.82

visual differences:

parametrised url


Original Link: https://dev.to/calidion/how-urls-change-performance-with-frameworks-and-raw-http-package-in-node-js-418j

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To