Hot answers tagged

19

Because there is a huge difference between optimizing the performance and turning off completely a safety By reducing the number of GC, their framework is more responsive and can run (presumably) quicker. Now, optimizing for the garbage collector don't mean they don't ever do a garbage collection. It just mean they do it less often, and when they do it, it ...


4

It seems the reason it's written in Java is that they have Java expertise in-house and it was probably written (although it's still in active development) before C++ got its act together with C++0x/11. Their code is really only Java by name, they use sun.misc.Unsafe quite a bit which kind of defeats the point of Java and the safety is supposedly gives. I ...


4

This question states an incorrect premise as fact, then makes an argument about that incorrect premise. Lets dig in to this .. "all their design points to minimizing GC use" - simply isn't true. The innovation in the disruptor has little to do with GC. The disruptor performs because its design cleverly considers how modern computers work - something that's ...


3

They would have to think low level Above makes half of the answer you're looking for. You can find another half to complete the reasoning no farther than in LMAX blog: While very efficient, it can lead to a number of errors as it is very easy to screw up... As admitted by LMAX developers, code like that might be quite difficult to develop, understand ...


3

If you use Java as a syntax language and avoid its JDK libraries it can be as fast as a compiled non-GC language. GC is not suitable for real-time systems, but it is possible to develop systems in Java that do not leave any garbage behind. As a result the GC never triggers. We believe that the Java language and platform have many advantages over C/C++ and ...


3

Hashing makes only sense in conjunction with an equality comparison. But if types contain double values like in your example, any sensible equality comparison should work with an "epsilon", something like bool Equal(Box b1,Box b2, double epsilon) { return fabs(b1.mins[0]-b2.mins[0])<epsilon && fabs(b1.mins[1]-b2.mins[1])&...


2

If you can generate a guaranteed unique hash, then do so. However this means your box coordinates must be relatively small (eg if a box can be between 0 and 1, in increments of 0.1 then you have 10 steps for each co-ordinate, making a possible 10^4 unique values, assuming no 2 boxes can overlap) In most cases you will not be able to guarantee a unique hash, ...


1

In your case, I would use a name that refers to the collection of functions that you have. For example: template Operations(A) { ... If you hadn't mentioned concatenate, then I would have suggested ArithmeticOperations for example.


1

LMAX is a High Performance Inter-Thread Messaging Library. To be useful someone else has to write the code to get each thread to do useful work. Given that the code is most likely to be in Java or C# and then there are very few chooses of language that interface well with them. Using C or C++ is not a good option unless you wish to limit your users to a ...


1

Scala is an OO language that has invariant, rather than covariant, arrays. It targets the JVM, so there's no performance win there, but it avoids a misfeature common to both Java and C# that compromises their type-safety for reasons of backwards compatibility.


1

or do I have to live with the fact that, for example, a Quicksort always does O(n log n) unnecessary runtime checks? CPU performance is not monotonic, which means that longer programs can be faster than shorter ones (this is CPU dependant, and it is true for the common x86 and amd64 architectures). So it is possible that a program doing bound checking on ...


1

The most important thing that C++ "does better" than D is interfacing with legacy libraries. Various 3D engines, OpenCL and alike. As D is new, it has far smaller amount of different libraries to choose from. Another important difference between the C++ and the D is that the C++ has multiple financially independent vendors, but as of 2014 the D has ...


Only top voted, non community-wiki answers of a minimum length are eligible