I think we can learn something here.
[–] kvemkon 11 hours ago
[–] iguessthislldo 10 hours ago
[–] pjmlp 10 hours ago
"Why we chose Java for our High-Frequency Trading application"
https://medium.com/@jadsarmo/why-we-chose-java-for-our-high-...
[–] jcelerier 9 hours ago
[–] prophet_margin 10 hours ago
[–] bayindirh 9 hours ago
Also, I also agree that people optimize without proper testing and profiling. If there's a real bottleneck here, trying to optimize it is the right call. OTOH, optimizing without profiling opens a lot of unnecessary cans.
Lastly, Go doesn't like constant allocation and deallocation of variables, that's true, but I believe knowing this and optimizing hot-loops for that goes a very long way as a start.
[–] legulere 8 hours ago
[–] pjmlp 10 hours ago
Like everything else in Go, its designers have decided to ignore learnings in GC systems languages.
[–] raggi 10 hours ago
Go/GC are mostly fine for medium frequency medium scale mid stack problems.
It’s bad for high frequency computing. It’s bad for very small targets, for very large targets, and by association software that lives at the very bottom of the stack.
Go is a high efficiency framework for writing mid sized servers, not a systems language. The runtimes hard opinions and closed interface are the reason for this enclosing definition and the GC is one part of that.
[–] vatsachak 11 hours ago
[–] ted_dunning 10 hours ago
The OP article here is nice because it allows selective enforcement of allocation free code. If you have code that has some discipline about heap allocation such as having all small allocations then you are OK on the fragmentation front.
[–] bootsmann 10 hours ago
[–] Groxx 7 hours ago
[–] pjmlp 10 hours ago
[–] fpoling 7 hours ago
[–] pjmlp 5 hours ago
Yet one still needs to account with processes like MISRA to account for safety.
[–] fpoling 7 hours ago
[–] treyd 11 hours ago
After a few rounds of this though it might end up seeming like it's not worth the hassle and it's easier to build the whole application in Rust.
[–] vatsachak 10 hours ago
[–] treyd 10 hours ago
[–] vatsachak 10 hours ago
For example,
- A field in a struct cannot borrow another field so now you'd have to create two structs. I guess you could write an impl to borrow that field instead of storing the borrow.
- In simulation software I wrote I found that mimalloc does just as good as bumpalo (within 5%) so carrying a bump everywhere was useless. Not really a rust issue but rather a loss of faith in manual memory management for me.
- Eventually over time you start adding Arc<Fn(Blah)->Foo> everywhere and Box, Arc and friends start coming in. But you can't have cyclical references there so you have to use Weak. And you have to use OnceCell or LazyCell or LazyLock for things that should run at start time.
Rust is really great for the crates, but ...
For applications which are not absolutely performance critical and cannot* be stated pretty easily in linear logic + clone + drop you can get away with Haskell
[–] Mawr 9 hours ago
[–] hoppp 11 hours ago
I don't see much point in choosing a language just to bypass it's features.
[–] cpgxiii 11 hours ago
Given the issues involved in mixing languages, there can be cases where sticking with one "good enough" GC'd language and having to write a few performance-sensitive parts in very unidiomatic form to minimize/eliminate GC work is preferable.
[–] revengerwizard 10 hours ago
[–] cpgxiii 6 hours ago
[–] eptcyka 9 hours ago