Re: Memory allocation overhead

Colin Paul Adams <[email protected]>
Newsgroups gmane.comp.lang.eiffel.gobo.devel
Message-ID <[email protected]>
>>>>> "Eric" == Eric Bezault <[email protected]> writes:

    >> Are other features of MEMORY (such as allocate_fast and
    >> set_memory_threshold) implemented?

    Eric> Not yet in gec. And I haven't studied yet whether the Boehm
    Eric> GC would provide such functionality.

OK.

But in any case, I am fairly confident that I know what the basic
problem I have is. Fixing it is another matter.

XSLT is largely concerned with manipulating strings. So I think the
lack of read-only strings, enabling substring to avoid copying the
string contents, is likely a very major factor.

I have some evidence in support of this.

1) The runtime of my program is non-linear wrt the size of the input
data set.
2) If I use the tiny tree implementation for the input data set, the
runtime increases by more than 4 times.

The tiny tree implementation is an application of
the flyweight pattern, designed to reduce the number of objects
created. I copied the idea from Saxon (the contents of all text and
comment nodes is held as a single STRING object within the document,
and access to it is by substring, avoiding creating text and comment
node objects for this purpose), but I overlooked that substring copies
the data in Eiffel.

Accordingly, I think I shall abandon my efforts for now, and pursue
Manu's suggestion in FreeELKS for an aliased substring feature (I
think full copy-on-write semantics will need to be available for
STRINGs). 
I don't doubt that there are opportunities to improve my use of
STRINGs in the code (a review would help), but I think this needs
tackling first.
-- 
Colin Adams
Preston Lancashire

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Register now and save $200. Hurry, offer ends at 11:59 p.m., 
Monday, April 7! Use priority code J8TLD2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.