* The Simplex math library is very user friendly to work with, and
based on the widely used glsl which was one of the better library
designs to come out of OpenGL standardization.
* Garbage collection hick-ups is maybe _the_ reason why the JVM is not
widely used on the client side in games. It's very important to avoid
long garbage collection pauses.
So, I'm in favor of trying to get the simplex math library to work
smoothly in one form or another.
Some thoughts, not sure if you guys tried them yet:
* Some kind of pool system for math object instances - keep weak
references to created instances, and re-use unused ones when a new one
is needed instead of creating a new instance. I've seen something
like this done with the special Java references (weak etc.) for data
access, not sure if it would work in this case.
* Can the garbage collector be configured to run more often? Or to be
more aggressive about collecting? With suitable command line
arguments or programmatically.
* Are there alternative garbage collectors for real-time systems that
could be used?
* Could some Scala type level- or implicit magic be used to eliminate
the need for creating new math object instances in cases where the
created objects are immediately passed as parameters to other math
objects, math object buffers, or properties?
-- Hans
On Sun, Jul 4, 2010 at 3:58 AM, Hicks, Matt
I wouldn't recommend bubble sort for any use.
Quicksort is pre-implemented for arrays in Java as well as most
programming languages, and has an average performance of O(n log n)
http://en.wikipedia.org/wiki/Quicksort
Merge sort is also often used, it has the nice property of being O(n)
in the case where the input is already sorted, and O(n log n) average
case (if I recall correctly Javas collections framework was using some
variant of it).
http://en.wikipedia.org/wiki/Merge_sort
-- Hans
Googling around, it seems timsort is a well optimized merge sort that
does quite well for data that is already sorted or partially sorted.
It's in use in python and Java 7. I found a Java version of it
online, but it was GPL2 licensed.
As Java 6- already has a merge sort for collections, I was thinking of
just using it - swapping out ListBuffer to an ArrayList inside
nodeview. It should still be quite fast, and reap any advantages of
Java library development. The only outside view of the collection is
an iterator getter, but I couldn't find the utility method for
converting a Java iterator to a Scala one.
(The sort algorithm provided by scala appears to be a standard
quicksort, so not a good idea for a renderlist which is going to be
almost sorted most of the time).
-- Hans