I have created this issue: https://nhibernate.jira.com/browse/NH-3486, and 
hope it will be accepted.

Best regards
Carsten


Den mandag den 6. maj 2013 14.26.04 UTC+2 skrev Carsten Hess:
>
> In my example I read 12000 rows with 38 columns and transform the data to 
> DTO's. With 3.3.3.4000 it takes around 4.5 seconds to do so.
>
> By using ANTS profiler I have spottet that the majority of the time is 
> spend getting the metadata for every row even though they are the same for 
> every one of them. One place to short-circuit this is in 
> CriteriaQueryTranslator - the 2 properties ProjectedTypes and 
> ProjectedColumnAliases - but it could also be made further down the 
> callstacks . 
>
> I made my own patch of 3.3.x (caching the 2 forementioned properties) and 
> my query then runs in under 1 sec. More than 80% saving. All NHibernate 
> test are green.
>
>
> My question is - would the team accept the change or how do I go about it ?
>
> I have tried logging in at 
> https://nhibernate.jira.com/secure/Dashboard.jspa but simply can't figure 
> out how to get a login!
>
> Best regards
> Carsten
>
>
>
> The change is as I said just to cache the properties in 
> CriteriaQueryTranslator:
>
>
>     private IType[] _cachedProjectedTypes;
>     private string[] _cachedProjectedColumnAliases;
>
>
> public IType[] ProjectedTypes
> {
> get
> {
>     if (_cachedProjectedTypes != null) return _cachedProjectedTypes;
>
>                 _cachedProjectedTypes = 
> rootCriteria.Projection.GetTypes(rootCriteria, this);
>     return _cachedProjectedTypes;
> }
> }
>
> public string[] ProjectedColumnAliases
> {
> get
> {
>     if (_cachedProjectedColumnAliases != null) return 
> _cachedProjectedColumnAliases;
>
>                 _cachedProjectedColumnAliases = rootCriteria.Projection is 
> IEnhancedProjection
> ? ((IEnhancedProjection)rootCriteria.Projection).GetColumnAliases(0, 
> rootCriteria, this)
> : rootCriteria.Projection.GetColumnAliases(0);
>
>     return _cachedProjectedColumnAliases;
> }
> }
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to