Try running it without the validation interceptor applied at all and see
how the numbers compare...

> -----Original Message-----
> From: Eric Webb [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, February 12, 2004 8:58 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [OS-webwork] is the validation interceptor slow 
> for anyone else?
> 
> 
> So, i've looked over the xwork validation interceptor and friends 
> (specifically com.os.xwork.validator.ActionValidatorManager), and it 
> seems to work the way one would expect it to.  All validators for a 
> given action-context are cached the first time it is run past the 
> ValidationInterceptor.  If a given action-context has no 
> validators (no 
> -validation.xml files in the class hierarchy) it caches that 
> as well.  
> Once cached, only one lookup to the map validatorCache is made for a 
> given validation request.
> 
> About performance:  I wanted to post some timing numbers for 
> comparison 
> and analysis, but i found them to fluctuate greatly on my 
> computer.  i 
> am running tomcat 5.0.18 on w2k with 1.5P4 and 728M ram.  I 
> didn't use 
> xwork directly, but simulated a form post multiple times by the same 
> user through webwork.
> 
> * For a simple 7 field form with "requiredstring" validation 
> for each field:
>        initial call: ~ 500ms
>        subsequent: 78ms - 172ms Avg: 145ms
> * The same 7 field form without a -validation.xml file (no validators)
>        initial call: 234ms
>        subsequent: 94ms - 172ms Avg: 145
> 
> I was using the following interceptors when running the 
> above: timer (to get the timing results) component (to 
> populate components - empty and unnessary in this case) 
> defaultStack (copy form values into the action class) 
> validation (perform the validation)
> 
> It seems on my hardware, the validation interceptor coupled with the 
> hashmap lookup (the cache) achieves an average of about 
> 145ms.  Perhaps 
> that is the best one can expect of this hardware?
> 
> What validation performance issues do others notice?  Anyone have any 
> ideas on further optimizations?  Is it necessary?
> 
> Cheers,
> eric
> 
> Jason Carreira wrote:
> 
> >Yeah, that's what I meant about optimizing... It could save 
> the result 
> >of searching the class hierarchy....
> >
> >Help on optimizations would be great.
> >
> >Jason
> >
> >  
> >
> >>-----Original Message-----
> >>From: Eric Webb [mailto:[EMAIL PROTECTED]
> >>Sent: Friday, February 06, 2004 2:50 PM
> >>To: [EMAIL PROTECTED]
> >>Subject: Re: [OS-webwork] is the validation interceptor slow 
> >>for anyone else?
> >>
> >>
> >>One day, trying to get the validation stuff to work for me, i steped
> >>through all of the validation intercept handler and friends.  in 
> >>ww2/xwork, there is caching that goes on.  It will only 
> look for the 
> >>ActionName-validation.xml, ActionName-AliasName-validation.xml, and 
> >>parents only once. 
> >>
> >>the cache is a hashmap in
> >>com.opensymphony.xwork.validator.ActionValidatorManager.  While the 
> >>files aren;t looked up each time, the entire action's class 
> >>hierarchy is 
> >>seached in the hashmap each and every time a validation 
> >>request comes in.
> >>
> >>I don't have more insight than that into your performance problems.
> >>but, there is alteast some caching going on already.
> >>
> >>I'd be happy to help on optimizing the validation code, but 
> i wont be
> >>able to until next week.
> >>
> >>cheers,
> >>eric
> >>    
> >>
> 
> -- 
> Eric Webb
> Programmer Analyst II
> University of Southern California
> University Park Health Center
> 
> Phone: (213) 821-2361
> Fax:   (213) 740-1794
> Email: [EMAIL PROTECTED]
> 
> 
> 
> -------------------------------------------------------
> SF.Net is sponsored by: Speed Start Your Linux Apps Now.
> Build and deploy apps & Web services for Linux with
> a free DVD software kit from IBM. Click Now! 
> http://ads.osdn.com/?ad_id=1356&alloc_id=3438> &op=click
> 
> _______________________________________________
> 
> Opensymphony-webwork mailing list 
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork
> 


-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id56&alloc_id438&op=click
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to