by kyrra · 7y ago · 0 comments
Java: https://github.com/ixy-languages/ixy.java/blob/master/ixy/sr...
C#: https://github.com/ixy-languages/ixy.cs/blob/master/src/ixy_...
Java needs a bit more C to make it work. C# only seems to need it for DMA access. But when you look at the Go code, they got away with being pure Go and using the syscall and unsafe package. So that's at least one plus for Go.
(the main readme calls this out, but at least one thing worth mentioning here too).
As a Java coder for my day-job, I do like the breakdown they have of the performance of the different GCs for their Java implementation. https://github.com/ixy-languages/ixy-languages/blob/master/J...
We do it all the time in Windows low level coding within .NET, the reason why they didn't beats me, most likely not knowledgeable enough of .NET capabilities.
As for Java, hopefully with projects Valhala, Panama and Metropolis Java will finally have the performance language features that should have been part of Java 1.0.
>"As C# cannot call mlock or get a raw pointer from a memory mapped file, DMA memory allocation is performed in C and called with the C# P/Invoke mechanism. Fortunately, this is the only instance of the driver calling a C function and the total amount of C code is only around 30 lines."
Objective-C was often called slow because iteration NSArray was much slower than doing it in C. Well, if you needed to do it fast in Objective-C you wouldn't do it using the user friendly and safe (for 1984) higher level objects.
I think only Rust really allows you to write really safe and still really fast code though.
I clicked through to a performance analysis showing ARC taking about 3/4 the time (in the release build).
You don't really need to be doing a lot of ARC in the inner loops if you don't want to.
Pull requests proving otherwise are welcome
Snabb (https://github.com/snabbco/snabb/) is written in LuaJIT . I assume an equivalent project in Rust would be a lot more expensive in implementation time and also lines of code.
There is also Common Lisp and SBCL in particular, which can produce extremely fast code without compromising on safety.
To measure how secure the resulting code is, have a test suite of malformed packets or other input and see how many of them the code in each language handles.
That measures how well a particular developer takes, with some noise induced by the working environment (say there's construction noise during python week, not during java week, or more meetings one week than another, or the developer's has relationship troubles at home). Randomness happens.
Deducing a number that's more generally valid requires having n workers doing the same work and then doing statistical analysis. Happily that also takes care of the single-worker problem. Still, the cost of the experiment easily rises by a factor of twenty or a hundred, depending on how well the noise can be controlled and how much accuracy is needed.
Asking for improvements that would increase the cost of an experiment by many thousand per cent is a %$#@!%#@! $%#@!%@#$ thing to do. IMO.