[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: plan for lightweight DOM implementation
From:       Thomas Zander <zander () kde ! org>
Date:       2005-10-30 16:05:25
Message-ID: 200510301705.26330.zander () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Sunday 30 October 2005 16:50, Ariya Hidayat wrote:
> I'd like to give a try to implement alternative DOM implementation
> which does not consume as much memory as typical QDom classes. 

Cool!!

> The idea is as follows. Each node does not necessarily load the
> attributes and its children at once, but rather only on-demand. Upon
> loading the main document, only information about the first level
> nodes/elements (which are children of the document) are loaded. 

Yes, that sounds good.

> Node can also have unload() method which explicitly purged its data
> from memory. This is useful when the program knows it will not use the
> node anymore.

Fine for a first version; I was more thinking of having a pool of objects 
(with attributes as well as nodes) and when the pool is full the ones 
longest not accessed will be automatically deleted.

> I expect a performance degradation since parsing needs to be performed
> many times. 

The slow part in XML parsing are things like the conversion of file-bytes 
to encoded text to integers.  Doing this lazily will probably save a lot 
of time.

> However, I estimate that memory requirement will be much 
> less. My guess is that this is worth doing it.

I agree.

> So I'm starting to work on this, and comments are warmly appreciated.

If you have an initial setup (i.e. non crashing :), feel free to post it 
somewhere with the unit tests so we can play with it and provide 
feedback.

Thanks for picking this up!
-- 
Thomas Zander

[Attachment #5 (application/pgp-signature)]

_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic