Fixed
Details
Details
Assignee
Alex Zaytsev
Alex ZaytsevReporter
S
SLabels
Components
Fix versions
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created January 22, 2013 at 1:24 PM
Updated September 21, 2014 at 12:42 PM
Resolved February 8, 2013 at 11:08 AM
As currently when constructing entities from a linq query, it calls Delegate class's dynamicInvoke, which is believe to be slow.
Improvement could be simple:
See attached file for sample of improving constructing items, for constructing list, same way could be applied.
Please be aware if you use any profiler tool to profile this, may not be able clearly identify the problem because transformer is called less time than retrieving row/column data from idatareader, but each call took longer time. Although in real life, transformer took more than half of time, but because of wall time costed by profiler, when profiling it only took less than 20% of time.
This is the quick fix I can find so far. But I believe the code in for retrieving row/column value from datareader can be improved as well.
for example in Type/AbstractStringType.cs, currently it uses unnessary converter.convertoxxx() method, which is slow. And after unnessary convert, it box the value to object again. It could be simplfied to rs.GetString(index). Same logic could apply to other types. Also, if you could flatten the struct when retrieving values, could help improve performance a lot.