java - Performance issues using LocalValidatorFactoryBean -
i'm trying understand why program's execution time long. aim of program import csv data, , validate line line.
it appears 90% of execution time spent validation of data. validation function :
public static <t> hashset<constraintviolation<t>> validate(validator validator, t resource, class<?>... groups) { return (hashset<constraintviolation<t>>) validator.validate(resource, groups); }
and validator use localvalidatorfactorybean, imported in spring :
<bean id="validator" name="validator" class="org.springframework.validation.beanvalidation.localvalidatorfactorybean"/>
i noticed validation taking more , more time @ every iteration... example, if i've got 1000 similar lines on csv file, first validated in ~55ms, , last in ~900ms.
i have no idea how explain non-linear execution time, , how improve : did mistake ? should configure bean differently ? should use other validator (which one?) ?
thanks time :)
aren't using linkedlist
? explain growing time, assuming there many columns , access fields not cache row.
try replace validation no-op , watch if times change. or debug call (or let throw , @ stacktrace) see funny things happen.
Comments
Post a Comment