Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why did your system dynamically allocate memory in the first place? High speed messaging sounds like an area where it should be doable to figure out at startup what resources you need to meet your latency and throughput requirements and then allocate them once and basically never gc anything. Was there some fundamental difficulty with that, or was it more that by the time your realized that GC would kill you, all your code was already written in a way that would have made it prohibitively expensive to switch to an architecture that avoids creating temporary objects?


Pretty much the latter: it was initially architected for 1x volume, but ended up handling 100x what was originally anticipated. So the engines were rebuilt a few times while the plane was in flight. As a bonus, while in production the system had to run 24x7 and upgrades were a fairly fraught manual affair involving hours of testing on the customer side.

The other major complication was that this was doing a lot of complicated protocol conversion, so it wasn't enough for the core message processing & routing to be solid and leak-free, all the input parsers and output converters had to be too.


The best part about using a garbage collected language for high performance software is it's exactly the same as a non-garbage-collected language.


Sure, as long as your non-garbage-collected language from ten years ago had memory safety (and general lack of UB footguns), first class IDE support, excellent introspection and profiling facilities and a large potential hiring pool of elite programmers and wide acceptance in the industries you were trying to sell into.


Why is it you think most major programs are built using C++? Most OS's, most drivers, most browsers, most games, most major applications, most compilers, most servers etc etc.


C++ completely dominates games, browsers (and a few things you don't list, such as competitive programming). It is certainly not marginal in the other areas you list either, but were do you get the weird idea that most operating systems and drivers are written in C++ (let alone most compilers, servers or "major applications")? Unix has completely won the OS market (what percentage of OS installs these days are unix derivatives? 99%+?) and I can't think of a single one that is predominantly or at all written in C++. Apart from lacking a browser, I'd be surprised if you couldn't run a fully functional linux desktop after deleting every single C++ application and library on your system.


Most servers, definitely not.

Consider that large chunks of Google, Twitter, Amazon, Alibaba etc run on Java.


Wait, are we still comparing C++ with Java here?


Yes? If you write zero or low allocation code in Java you pay a price for working against the language and you also lack several tools for writing fast code that C++ provides you with (as well as a bunch of useful abstractions), but your development experience will obviously be much better on a number of other dimensions.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: