3 ms·
I suspect the reason it's not faster is one of the following: 1. backend DB at its query limit 2. this is basically my first rust program and I've done som
by tech2 8y ago
I suspect the reason it's not faster is one of the following:
1. backend DB at its query limit
2. this is basically my first rust program and I've done something stupid
3. ab/wrk aren't scaling properly either (I know, not likely, but worth considering) when I'm testing it
4. bandwidth/IO limits on the AWS instance types I'm running this on
There are other possibilities too I guess. I was mostly doing this as a means to learn Rust though, I'd only go live with it once I had decent tests and everything else.
- the_duke 8y agoWhat web framework are you using? Are you using a database? If so, which one? Are you using a cache like Redis? I agree that a 2x speedup is a terribly low for a Python to Rust rewrite and shows that Python is unlikely to be the relevant bottleneck here.
- tech2 8y agoactix/r2d2 on the Rust side (I haven't worked out bb8 yet), aiohttp/uvloop/asyncpg/gunicorn on the Python side (Postgres for the DB). This kinda _is_ the cache at present, it's a distillation of a lot of other data into a given form. Rust's async story re: databases still looks a little up-in-the-air right now from an outside perspective though, so I guess I'll wait and see how it pans out. It's definitely a work in progress and I didn't expect this much interest in my offhand "I tried Rust even though I couldn't see myself using it for real, but..." comment.
- weberc2 8y ago> What web framework are you using? I can't imagine the web framework is the bottleneck...
- the_duke 8y agoIt might be because if it's a tokio-core based one OP might be blocking the event loop too much.