| ▲ | DarmokTanagra 20 hours ago | ||||||||||||||||
Sure, but now if my rust application isn't using tokio I have to include it as a new dependency because the author of this lib decided to use it as his async runtime? I'm not trying to be pedantic, but this split over async runtimes was what originally turned me off of rust years ago and it still seems to be an issue. | |||||||||||||||||
| ▲ | vlovich123 16 hours ago | parent | next [-] | ||||||||||||||||
Because Tokio, while great for lots of things (ie default decent performance with ease of use), is a performance bottleneck if you want extremely high performance. For example, the best this DB can do is ~3.7Mkeys/s for non durable writes and 162k/s for durable. I have an equivalent DB that’s always durable and does 30M/s* (for 8 byte entries) because it doesn’t use Tokio among other things. For this dataset it would be saturating the disk I/O no problem so I would expect it to be running ~7-14M/s depending on how fast your SSD is (~2-4x faster than non durable mode and 40-80x faster than its “durable”) * it was running at 70-100mhz at one point but the challenge is keeping the hot path at ~10ns as you add features and other things. | |||||||||||||||||
| |||||||||||||||||
| ▲ | timschmidt 19 hours ago | parent | prev | next [-] | ||||||||||||||||
I'm using async on esp32 with embassy, for instance, where there's simply no room and no need for a runtime as complex as tokio. | |||||||||||||||||
| ▲ | insanitybit 19 hours ago | parent | prev | next [-] | ||||||||||||||||
You would only have to include it if the library uses `spawn`, as far as I am aware, or some tokio specific type, which is the same as any other library. | |||||||||||||||||
| ▲ | airstrike 18 hours ago | parent | prev | next [-] | ||||||||||||||||
The author of this library can leave the async library choice up to the user. iced does that quite well. | |||||||||||||||||
| ▲ | tinco 19 hours ago | parent | prev | next [-] | ||||||||||||||||
It's not pedantry, you're trying to find something in Rust that's simply not there. If this sort of thing turns you off on Rust you should be looking at a programming language with other priorities. | |||||||||||||||||
| ▲ | derriz 19 hours ago | parent | prev [-] | ||||||||||||||||
I’ve had the same reaction. We’ve seen this play out in other language eco-systems (Java - JAXP, javax.validation, JPA, etc all ended up with a de facto single implementation) and the idea of pluggable implementations sounds appealing but rarely pays off. The price that Rust paid for this abstraction - which in fact ended up not being useful as tokio is the only reasonable choice - was high in terms of requiring ugly (to my eyes) changes to its type system. | |||||||||||||||||
| |||||||||||||||||