3 ms·
Yeah, yeah, Python is fast... nevermind that my program (that does real work) that I ported from idiomatic Python to idiomatic Rust became around 140 times fast
by loxs 6y ago
Yeah, yeah, Python is fast... nevermind that my program (that does real work) that I ported from idiomatic Python to idiomatic Rust became around 140 times faster. Real world doesn't matter, synthetic benchmarks (with clever calling of C code) are the way to go :)
PS. The Rust version is also easier to read, maintain and understand (for someone who groks algebraic types and Rust in general), not to mention a lot safer.
- throwdbaaway 6y agoSpeaking of real world, in your case, would the Rust version come into existence without the Python version being written in the first place? Here's a real world example: https://github.com/sripathikrishnan/redis-rdb-tools https://github.com/sripathikrishnan/redis-rdb-tools - python, optional C library dependency to liblzf, fully-featured, pure-python performance is decent enough when using pypy https://github.com/badboy/rdb-rs https://github.com/badboy/rdb-rs - rust, inspired by the former, not fully-featured, abandoned, may or may not have great performance Rust is great, but I just want to contend that the real world picture is a lot more nuanced than how you painted it.
- loxs 6y agoI don't know how I painted it in your eyes, but at least my intention was exactly to point out that the real world is nuanced. I never said that python should not exist. I celebrate its strong parts like being a great first language and maybe, if you know what and why you are doing, great language overall in some specific situations. My comment was mostly against trying to pretend that Python is fast, which it is definitely not, and everyone who knows another language can very easily prove it to themselves and to the world. Regarding this specific library... Redis is not really very useful to a Rust program, because one usually loses performance by using it, instead of gaining some (which would be the case for a Python program). One would either use native data-structures for simple things (read, where Redis would be useful) or a "real" database if something more complex is needed. If working with Redis (and its dump files) was some real priority, the rustlers would come up with something with equal quality to the python library you linked. Maybe something like this, but for Redis dump files: https://github.com/serde-rs/serde https://github.com/serde-rs/serde