In article <Pine.LNX.3.96.1010320124128.25158D-100000 / relayer>, Mathieu Bouchard <matju / sympatico.ca> wrote: > creating a new class of floats for ruby would be worthwhile if you wanted > low-memory use and speed > in a context where you cannot reasonably use NArray (in > which case it'd be interesting to know why). For example, my full time job is to create unit commitment and economic dispatch software to optimise the scheduling of electrical power generation. This involves models with a few classes and tens of thousand objects (sometimes many more) that describes the power systems using a few floats. If I were to use arrays to store these data, I would loose the advantage of the nice & flexible object model, and would rather use Fortran to get a major speed increase (like we do in our non-experimental softwares). Sometimes, most of the time is spent wandering across the objects, doing tests, floating points calculations and changing the values in the objects. Even if the values were stored in NArrays, it would be of no use since the code would almost not use any of the array operations. Eliminating the creation/deletion of millions of floats by storing them in the object reference should greatly improve speed (a bit less than two times faster assuming the GC is disabled (or very efficient)). While speed is not why I use ruby, it is still nice to have it perform well. (besides, loosing 1 bit in the Fixnums may not be significant ?) If not for speed, I cannot think of a reason (but there may be one) to store the integers in the references. js (to moderate my problems, sometimes, everything can be written as a big linear optimization problem, and the performance of the langage used does not matter at all (CPlex or else does the job))