5 ms·
I wouldn't be very sure about the claim that "D can never compete with Rust in performance and real-time or soft-real-time systems". If anything, due to much be
by FraaJad 10y ago
I wouldn't be very sure about the claim that "D can never compete with Rust in performance and real-time or soft-real-time systems". If anything, due to much better metaprogramming (as you mention), you can have D programs that ARE faster than Rust (eg: see JSON parsing benchmark [1]).
You can write programs in D that have ZERO garbage collection.
In fact, the core libraries (phobos) are being actively rewritten to remove GC altogether.
[1]: https://github.com/kostya/benchmarks#json https://github.com/kostya/benchmarks#json
- PeCaN 10y agoLast I checked, JSON parsing is not a typical (soft-)real-time workload. Heck, GC probably doesn't even kick in in that JSON benchmark. And yes, I'm aware that Phobos is being rewritten to remove GC. I'll reevaluate D when that's complete.
- steveklabnik 10y agoThe D "fastjson" version is not a general solution: > I think it is not necessary to validate data you are not using. So basically > I only scan them so much as to find where they end. Granted it is a bit of > optimization for a benchmark, but is actually handy in real-life as well. > After all you could still raise the validation level to maximum if you really > cared or call one of the validation functions. https://github.com/kostya/benchmarks/pull/46#issuecomment-147932489 https://github.com/kostya/benchmarks/pull/46#issuecomment-14...
- yawniek 10y agoshameless plug, you can use https://github.com/tamediadigital/asdf https://github.com/tamediadigital/asdf it should offer comparable performance to fastjson while having all the nice features.