Skip to content

Conversation

ghost
Copy link

@ghost ghost commented Jan 13, 2015

Hi!
We have rather big code-first NH-model in our project with thousand classes and long hierarchy chains.
Testing showed that from two to five minutes are spent on bulding model. Profiling showed thant 70% time is spent in FluentNHibernate, particulary in SeparateSubclassVisitor.IsMapped method.
I suggest a performance fix that optimizes this method. Now our model builds in less than one minute and most time is spent in NH itself.
We are already using this patched version in our project, but it is likely to have it merged with FNH master for updating reasons.
Any comments are welcome, if you need a model and prototype-project with this properties we can provide it.

@chester89
Copy link
Collaborator

Well, I can see why it's faster than previous implementation 👍 Looks good to me

@chester89
Copy link
Collaborator

On the other hand, if that's just a wrapper around a HashSet, maybe we can avoid new collection type altogether. I'll take a closer look tomorrow

@ghost
Copy link
Author

ghost commented Jan 13, 2015

I can't see the big picture, that's why I wrapped the collection. But if
it's possible to simplify it, that will be great.

@ghost
Copy link
Author

ghost commented Jan 23, 2015

Is there any progress with this case?

@chester89
Copy link
Collaborator

Let me check List vs HashSet with a lot of Type instances in it. I suspect it's much better (O(1) vs O(n)). This will appear in the next release - but I'm not sure when that's happening.

@ghost
Copy link
Author

ghost commented Jan 23, 2015

Ok, will wait for the release then.

@chester89 chester89 merged commit ffc2c19 into nhibernate:master Oct 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants