[Mono-devel-list] Managed Char class/ structure implementation

Paolo Molaro lupus at ximian.com
Sat Feb 21 10:59:27 EST 2004


On 02/20/04 Andreas Nahr wrote:
> Its features are now:
> - completely standalone (uses no internalcalls)
> - extremely fast (about 250% to up to 1000% faster than Mono AND MS impl.)
> - eats LOADS of memory
> 
> and thats also the problem... How much memory usage might be acceptable? Is

The concept is good: I actually wanted to try something like that, by
having GLib expose its internal data tables so we could have avoided the
icalls, but I doubt the GLib maintainers would ever expose the internal
details.
As you guessed, the memory requirements of your approach are not
acceptable, though: roughtly 100 KB of managed memory is a lot.
Thre is a way that would make it ok: instead of having the arrays in
managed memory, we could store them as readonly data in the runtime
and have the Char class use unsafe pointers to them. This requires the
use of unsafe {} constructs, but it's just as fast and the memory
is not duplicated, but mmapped readonly for all the mono processes.
I would also drop the NumericData array: it's very sparse and
GetNumericValue() doesn't look like a method that would need to be so
fast.

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list