salvo-rs / salvo

A powerful web framework built with a simplified design.
https://salvo.rs
Apache License 2.0
2.92k stars 172 forks source link

2 features request. #791

Closed sprappcom closed 1 week ago

sprappcom commented 1 month ago
  1. can you make it faster than hyper on techempower benchmark?

  2. how to have multi threaded mode? e.g. 1 process per cpu core

narad-muni commented 1 month ago

If you need something faster than hyper, probably use react js for that.

sprappcom commented 1 month ago

@narad-muni how can react js be faster than hyper?

can salvo pls make it much faster? on tech empower benchmark it looks really slow

Volkor3-16 commented 1 month ago

@sprappcom

It seems like it already is faster on the techempower benchmark. (how is this possible? doesn't salvo use hyper as a http backend?)

Salvo - 10th. Hyper (hyper-db) 30th

Are you just chasing benchmarks, or are you running into a performance issue?

sprappcom commented 1 month ago

@Volkor3-16 i'm running into performance issues.

salvo doing 2mil req/s on hello world vs gnet golang at 7mil. it's slower than hyper here. if i cant get performance out of hello world, how can i expect to add more batteries into it and still have performance?

https://www.techempower.com/benchmarks/#hw=ph&test=plaintext&section=data-r22

astoring commented 1 month ago

The results of the benchmark are determined by multiple factors. Please do not judge whether a program is fast or slow based on a single test result.

Objectively speaking, Rust's plain text scores are not high, but as business logic increases, Rust's performance advantage will become more obvious.

https://www.techempower.com/benchmarks/#hw=ph&test=fortune&section=data-r22 For example, in the Fortunes test here, salvo ranks tenth, which is not a bad result. However, the best scores of Rust in the plaintext test have all declined overall.

https://web-frameworks-benchmark.netlify.app/result?l=rust From this test, we can also see that the scores of Rust frameworks are not much different, and salvo is not much slower than axum.

astoring commented 1 month ago

@sprappcom

First of all, how the test itself is written has a great impact on the results. In addition, hyper may not be the same version as salvo, and different versions of hyper have different performance.