S
Sebastian Dröge
coaxion.net · Personal blog · on HN since 2016
Sebastian Dröge, a GStreamer developer, writes about multimedia plugins, Rust, and performance work.
What HN saysHN commenters cite his posts in Rust debates, including bounds-checking costs and integrating Rust into existing C codebases.
16HN people shared it
4linked it in comments
14stories submitted
84story points
3 years agolast shared
2016people per year2026
Most-shared posts
- 1Exporting a GObject C API from Rust code and using it from other languages3 people · 5 points · first shared 2017 · discussion on HN
- 2Writing GStreamer plugins and elements in Rust2 people · 3 points · first shared 2016 · discussion on HN
- 3Building a GStreamer plugin in Rust with meson instead of cargo – coaxion.net2 people · 3 points · first shared 2023 · discussion on HN
- 4
- 5Porting EBU R128 audio loudness analysis from C to Rust1 people · 57 points · first shared 2020 · 6 comments on HN
- 6Improving many-streams GStreamer performance and scalability with Rust/Tokio1 people · 3 points · first shared 2018 · discussion on HN
- 7GLib/GIO async operations and Rust futures and async/await1 people · 2 points · first shared 2018 · discussion on HN
- 8Getting RSS feeds for news websites that don’t provide them1 people · 2 points · first shared 2016 · discussion on HN
- 9Instantaneous RTP synchronization and retrieval of absolute sender clock times1 people · 2 points · first shared 2022 · discussion on HN
- 10GStreamer Elements in Rust: Parsing data from untrusted sources like it’s 20161 people · 2 points · first shared 2016 · discussion on HN
- 11Writing GStreamer Elements in Rust (Part 2)1 people · 2 points · first shared 2016 · discussion on HN
- 12Porting EBU R128 audio loudness analysis from C to Rust – Porting Details1 people · 2 points · first shared 2020 · discussion on HN
- 13The GTK Rust bindings are not ready yet? Yes they are!1 people · 1 points · first shared 2019 · discussion on HN
What HN people wrote when they linked it
PathOfEclipse · 2022-10-25
If your bounds checks can make your programs as much as twice as slow, then I think it's worth considering that bounds checking is not a panacea for low-level code: https://coaxion.net/blog/2018/01/speeding-up-rgb-to-grayscale-conversi…
MaulingMonkey · 2019-03-30
> Seems bad for rust that safe code is 25x slower.
Most of the optimizations listed have nothing to do with unsafe, and have to do with algorithmic changes that you could apply in any language, and could apply to safe code just as well as to unsafe code. Even if we pretend all unsafe used there is necessary, and interpret the source in the worst possible light for rust - that the optimization steps would be impossible without unsafe - I think we'd only be talking 4x to 5x slower from this article, not 25x.
But - I strongly suspect not all that unsafe is necessary, and the post certainly doesn't claim it is.
The first code snippet uses unsafe to skip bounds checks. There are plenty of other ways to get the optimizer to skip them for you in safe code - or at the very least, hoist them out of the loop instead. This seems like a good read showing some concrete examples:
https://coaxion.net/blog/2018/01/speeding-up-rgb-to-grayscale-conversi…
Explicitly using SIMD code like the second code snippet does might require unsafe for the transmuted slicing under the hood (implemented as raw pointer derefs in this case), but it's possible to build safe abstractions on top of that. That blog post links this, for example, although it didn't end up using it (EDIT: Actually, it initially didn't, but now does): https://github.com/AdamNiederer/faster . It does use unsafe internally: …
zokier · 2023-07-09
That is mischaracterization. Rust has been intended to be able to incrementally integrate to C/C++ codebases, of course most significantly integrating Rust/Servo components to Firefox/Gecko.
See for example this rsvg presentation[1] and gstreamer blog post[2] for examples of the interop
[1] https://viruta.org/docs/fmq-porting-c-to-rust.pdf
[2] https://coaxion.net/blog/2016/05/writing-gstreamer-plugins-and-element…