View previous topic :: View next topic |
Author |
Message |
stonecobra
Joined: 25 May 2004 Posts: 48 Location: Rough and Ready, CA
|
Posted: Mon Sep 10, 2007 9:33 am Post subject: Feature Request: re-entrancy |
|
|
In using an XML parser in a server side env, you usually instatiate a parser, and then call parse() as many times as necessary, setting in new content each time.
I assume it would be fairly easy to allow Sendero's parser instances to be re-used? |
|
Back to top |
|
|
aaronc542
Joined: 22 May 2007 Posts: 35 Location: NJ, USA
|
Posted: Mon Sep 10, 2007 10:41 am Post subject: |
|
|
Well the instance size of an XmlParser shouldn't be very large (~34 bytes), but in a high-performance environment it might be nice to just use the same instance so your garbarge collector has less work to do.
How would a reset(ch[] newText) method work for this purpose?
If you get a chance to test the parser, do tell about your experience.
Yours,
Aaron |
|
Back to top |
|
|
stonecobra
Joined: 25 May 2004 Posts: 48 Location: Rough and Ready, CA
|
Posted: Mon Sep 10, 2007 11:49 am Post subject: |
|
|
aaronc542 wrote: | Well the instance size of an XmlParser shouldn't be very large (~34 bytes), but in a high-performance environment it might be nice to just use the same instance so your garbarge collector has less work to do.
How would a reset(ch[] newText) method work for this purpose?
If you get a chance to test the parser, do tell about your experience.
Yours,
Aaron |
You are right, not very large, but if you use 3 to serve a single request, and you are doing 1000 requests/second, you are now 'leaking' 30KB/second that the GC has to clean up.
This method would do nicely.
Could you also put convenience methods on XmlForwardNodeParser like:
* a ctor that takes a char[] (implicitly creates the string iterator and xml parser behind the scenes.)
* a reset method there as well.
* tango Buffer support would be really nice. |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|