FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Feature Request: re-entrancy

 
Post new topic   Reply to topic     Forum Index -> Sendero
View previous topic :: View next topic  
Author Message
stonecobra



Joined: 25 May 2004
Posts: 48
Location: Rough and Ready, CA

PostPosted: Mon Sep 10, 2007 9:33 am    Post subject: Feature Request: re-entrancy Reply with quote

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
View user's profile Send private message
aaronc542



Joined: 22 May 2007
Posts: 35
Location: NJ, USA

PostPosted: Mon Sep 10, 2007 10:41 am    Post subject: Reply with quote

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
View user's profile Send private message
stonecobra



Joined: 25 May 2004
Posts: 48
Location: Rough and Ready, CA

PostPosted: Mon Sep 10, 2007 11:49 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Sendero All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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