Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve some sparse arrays #3649

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AlexanderKot
Copy link

Some sparse arrays exists after my app initialized related to NHib.

image

1

Object type Wasted Wasted After Count Count After
System.Collections.Concurrent.ConcurrentDictionary+VolatileNode<System.Tuple<System.Int32, System.String>, System.String[][]>[] 2,27 MB 0 8047 0

image

Improved by making Loader._subclassEntityAliasesMap lazy initialized
simple entities more frequent in data model then inheritance hierarchy

2

Object type Wasted Wasted After Count Count After
NHibernate.SqlCommand.SqlString+Part[] 736,47 KB 17.48 KB 20339 20343

image

Object type Wasted Wasted After Count Count After
NHibernate.SqlCommand.Parameter[] 410,4 KB 23.58 KB 20329 20331

image

Improved by TrimExcess in internal SqlString(IEnumerable parts) constructor

3

Object type Wasted Wasted After Count Count After
NHibernate.Mapping.ISelectable[] 440,4 KB 9.07 KB 18806 19966

image
image

Improved by SimpleValue.columns 1 default list size (Most simple values mapped to 1 column in DB)

Object type Wasted Wasted After Count Count After
NHibernate.Mapping.Column[] 332,78 KB 1.4 KB 14658 14658

image
image
image

Improved by
Constraint.columns 1 default list size (Most FKs is 1 column)
Index.columns 1 default list size (indexes created for FK usually created by 1 column)
ForeignKey.referencedColumns - make it lazy initialized as not used when referencing PK
ForeignKeyKey - TrimExcess on internal collections

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.

1 participant