rexyai / RestRserve

R web API framework for building high-performance microservices and app backends
https://restrserve.org
276 stars 32 forks source link

Benchmarking vignette #170

Closed schloerke closed 3 years ago

schloerke commented 4 years ago

Hi @dselivanov !

From request: https://github.com/the-benchmarker/web-frameworks/pull/3334#issuecomment-700169246

I've updated the document to try to have plumber do the same code style path as what RestRServe performs. I added in plumber + future into the comparison image at the bottom.

Please re-run the document chunks manually to regenerate the images using your machine (plot_results() calls ggsave()).

Other updates:

I am shocked as to how good future works within plumber. I was not expecting that. The performance could be dramatically reduce if the amount of communication was increased (which RestRServe would not need to worry about).

This is your document. Please update/adjust/tweak/toss/include any of the content.

Best, Barret

schloerke commented 4 years ago

btw... from my local testing of other frameworks in https://github.com/the-benchmarker/web-frameworks, I think R as a whole is going to get crushed. 😞

dselivanov commented 4 years ago

@schloerke thanks for PR! It will take some time to review (hopefully early next week).

schloerke commented 4 years ago

Had feedback to update the axis labels to avoid confusion. The plots will need to be re-rendered.

dselivanov commented 3 years ago

I'm really sorry that it takes so long to review. Very busy last weeks. Mb @artemklevtsov can help with initial review?

schloerke commented 3 years ago

@dselivanov Take your time. I understand. Hopefully it can be of use before your next release.

dselivanov commented 3 years ago

@schloerke sorry once again that it took that long. I've updated couple things and pushed in your branch. Major is keep-alive parameter (which was 10000 and now -1). It seems didn't work properly on newer versions on apib (mb it is in nanoseconds?).

future seems introduce significant latency and it doesn't look it worth to use it when computation requirement is moderate...

dselivanov commented 3 years ago

Also I've switched to desktop machine for benchmarks. On laptop they are not reliable at all - system changes CPU frequency very aggressively depending on temperature and number if cores used (each time I run results were considerably different).

dselivanov commented 3 years ago

Another observation is that plumber with keep alive disabled performs better compared to keep alive enabled... Which is counter intuitive and generally should not be the case.

t-wojciech commented 3 years ago

Here are the new results from web frameworks benchmarker.

Pos | Language | Framework | Speed (64) | Speed (256) | Speed (512) 107 | r (4.0) | rserve (1.7) | 41 968 | 29 638 | 29 848 189 | r (4.0) | restrserve (0.3) | 2 754 | 2 652 | 2 582 192 | r (4.0) | httpuv (1.5) | 1 912 | 1 814 | 1 736 200 | r (4.0) | plumber (1.0) | 429 | 438 | 432

CC @vikram-rawat