#prog #rust #js #article #successstory
Статья о том, как переписали с нуля плеер asciinema на Rust (с компиляцией в WASM) и Solid.js и получили прирост производительности в 50 раз.
(thanks @theLastOfCats)
Цитаты:
"At first I planned to implement the terminal emulation part in Rust without any optimizations, just write idiomatic Rust code, then revisit the tricks from the old implementation. The initial benchmarks blew my mind though, showing that spending additional time on optimizing the emulation part is absolutely unnecessary."
"I still thought I may need to implement some form of terminal state snapshot/restore to support the “seeking” feature. This feature requires feeding the terminal emulator with the whole text stream between the current position and the desired position, or in the worst case when you’re seeking back, feeding the emulator with the whole text from the very beginning of the recording up to the desired position. Optimizing this could be done, for example, by keeping snapshot of the terminal emulator state at multiple time points, sort of like having key-frames every couple of seconds. In ClojureScript implementation this came for free, thanks to the immutable data structures. In the new JS+Rust implementation this would have required extra work, but it turned out, that’s not needed either - clicking on the progress bar in the new player, to jump to the desired time in the recording, results in instantaneous jump, even when it has to feed the emulator with megabytes of data to parse and interpret."
Статья о том, как переписали с нуля плеер asciinema на Rust (с компиляцией в WASM) и Solid.js и получили прирост производительности в 50 раз.
(thanks @theLastOfCats)
Цитаты:
"At first I planned to implement the terminal emulation part in Rust without any optimizations, just write idiomatic Rust code, then revisit the tricks from the old implementation. The initial benchmarks blew my mind though, showing that spending additional time on optimizing the emulation part is absolutely unnecessary."
"I still thought I may need to implement some form of terminal state snapshot/restore to support the “seeking” feature. This feature requires feeding the terminal emulator with the whole text stream between the current position and the desired position, or in the worst case when you’re seeking back, feeding the emulator with the whole text from the very beginning of the recording up to the desired position. Optimizing this could be done, for example, by keeping snapshot of the terminal emulator state at multiple time points, sort of like having key-frames every couple of seconds. In ClojureScript implementation this came for free, thanks to the immutable data structures. In the new JS+Rust implementation this would have required extra work, but it turned out, that’s not needed either - clicking on the progress bar in the new player, to jump to the desired time in the recording, results in instantaneous jump, even when it has to feed the emulator with megabytes of data to parse and interpret."
blog.asciinema.org
4x smaller, 50x faster · asciinema blog
News about asciinema development and new releases
#prog #rust #article #successstory
Parsing logs 230x faster with Rust
As fantastic gravy on top of this whole situation, after a few days I realized that I needed to know exactly how much it would cost. With each log file taking about 23 seconds, and there being about 500 log files per day, it seemed like I would need about 350,000 seconds of Lambda execution time per month.
Then, when I went to look up Lambda pricing, I noticed that it has a free tier: 400,000 seconds per month. So in the end, it seems like I’m parsing 500GB of logs per day… for free. 😆
Parsing logs 230x faster with Rust
As fantastic gravy on top of this whole situation, after a few days I realized that I needed to know exactly how much it would cost. With each log file taking about 23 seconds, and there being about 500 log files per day, it seemed like I would need about 350,000 seconds of Lambda execution time per month.
Then, when I went to look up Lambda pricing, I noticed that it has a free tier: 400,000 seconds per month. So in the end, it seems like I’m parsing 500GB of logs per day… for free. 😆
Cloud City Development
Parsing logs 230x faster with Rust
Perhaps surprisingly, one of the most challenging things about operating RubyGems.org is the logs. Unlike most Rails applications, RubyGems sees between 4,000 and 25,000 requests per second, all day long, every single day. As you can probably imagine, this…
Чуть-чуть старая (октябрьская) #successstory
Patent troll Sable pays up, dedicates all its patents to the public!
Это — заключение судебного процесса, в ходе которого патентный тролль Sable пыталась стрясти денег с Cloudflare.
(thanks @itpgchannel)
Patent troll Sable pays up, dedicates all its patents to the public!
Это — заключение судебного процесса, в ходе которого патентный тролль Sable пыталась стрясти денег с Cloudflare.
(thanks @itpgchannel)
The Cloudflare Blog
Patent troll Sable pays up, dedicates all its patents to the public!
We’re pleased to announce that the litigation against Sable has finally concluded on terms that we believe send a strong message to patent trolls everywhere — if you bring meritless patent claims against Cloudflare, we will fight back and we will win.
❤3🔥2
#prog #successstory
Memory-safe PNG decoders now vastly outperform C PNG libraries
Не "Rust PNG decoders", потому что в список также входит wuffs
Memory-safe PNG decoders now vastly outperform C PNG libraries
Не "Rust PNG decoders", потому что в список также входит wuffs
🔥4👍2