Hi EntityModeToTuplizerMapping holds a dic keyed by entitymode internally. From a perf perspective, it’s a bad thing to do – enum as a key will cause a lot of boxing internally in dictionary operations. And in (large) resultsets these dictionary items in it will be retrieved _a lot_.
I just made a quick test and changed this dictionary to be keyed by an int instead (casting the enum to int when added), some extreme queries (=fast query, big resultset) run approx 10% faster in total. I’ll be glad to send this little patch. However, I would say a better solution would be to change this enum to a class instead (I don’t really like enums at all :)). I can provide a patch for this as well, but this type has a lot of dependencies. In short words – before spending some hours doing this, I would like to see if you have any opinions on this? Whatever you think, I would strongly suggest that get rid of often used dictionaries keyed by enums. Keep up the great work! Regards Roger
