5 ms·
Benchmarks are important actually. Maybe they are not 100% accurate but they do tell you that rust is faster than go. Since rust is also more complex than go, y
by some_account 8y ago
Benchmarks are important actually. Maybe they are not 100% accurate but they do tell you that rust is faster than go. Since rust is also more complex than go, you have to decide if it's worth complexity and learning curve for the speed.
Without benchmarks, we all would use python for everything right? :)
- _ph_ 8y agoWell, no. Some of the presented benchmarks prevent the Go solution to be as efficient as the Rust one by their rules, e.g. prohibiting object pools in Go, but not in other languages. Same with hash tables. They benchmark the default Go hash tables vs. custom implemented ones for the benchmark in C.
- seba_dos1 8y agoWhich, at least for hash tables, seems completely reasonable and representative of most actual experiences with both languages?
- _ph_ 8y agoNo. Standard libraries are a good thing, but if you want to write performant code, you definitely should consider a more specific implementation which is tuned to your actual problem. This is good practise in any programming language. But the rules of this benchmark page explicitly prohibit that, so languages, which don't have hash tables in their "standard" library have a strong advantage, which isn't a good representation of the speeds of well writting programs in those languages.
- seba_dos1 8y agoIn terms of performance, languages which don't have has tables in their standard library have an advantage in real life too, not just in the benchmark. While what you say is true, in great majority of the real life cases, if there's hash table implementation in the library, the developer will use that. If there's none, then they will start looking for one, making it more likely that they will choose a more fine-tuned to their needs implementation than if they already had generic one provided in the standard library.
- dullgiulio 8y agoOr, more realistically, the first answer on Stack Overflow that, as we all know, is the wrong one. The right one is always under the fold, with more upvotes but not selected as right by the asker. A standard library for a language will most probably get more attention from developers than any external library.
- igouy 8y agoNo, a "custom implemented" hash table is not used for the benchmark in C. A generic hash table from a third-party library is used -- something written to be generally useful, not compromised to look good on a toy benchmark. https://github.com/attractivechaos/klib/ https://github.com/attractivechaos/klib/
- vanderZwan 8y agoYes, benchmarks are important, which is why we should use proper ones. The Benchmarks Game is not one of those.