Skip to content

TupleDescriptor performance improvements#14

Merged
alex-kulakov merged 31 commits intoDataObjects-NET:masterfrom
servicetitan:tupledescriptor-nocache
Apr 9, 2020
Merged

TupleDescriptor performance improvements#14
alex-kulakov merged 31 commits intoDataObjects-NET:masterfrom
servicetitan:tupledescriptor-nocache

Conversation

@AlexUstinov
Copy link
Copy Markdown
Contributor

This pull request mainly contains changes to speed up TupleDescriptor creation. It also reduces memory consumption by storing PackedFieldDescriptors in a compact structs instead of overflown with data fields classes.
There are other performance improvements (See commit messages).

The table below presents results of benchmarking of TupleDescriptor.Create method for tuples of length 1, 2, 3, 4 and 45.

|                  Method |               NuGetReferences |         Mean |      Error |     StdDev |  Gen 0 | Gen 1 | Gen 2 | Allocated |
|------------------------ |------------------------------ |-------------:|-----------:|-----------:|-------:|------:|------:|----------:|
| TupleDescriptor_Create1 |                         6.0.1 |     33.21 ns |   0.564 ns |   0.826 ns |      - |     - |     - |         - |
| TupleDescriptor_Create2 |                         6.0.1 |    512.05 ns |   3.245 ns |   4.654 ns | 0.1984 |     - |     - |     832 B |
| TupleDescriptor_Create3 |                         6.0.1 |    631.16 ns |   4.651 ns |   6.520 ns | 0.2251 |     - |     - |     944 B |
| TupleDescriptor_Create4 |                         6.0.1 |    771.58 ns |   5.467 ns |   7.484 ns | 0.2460 |     - |     - |    1032 B |
|  TupleDescriptor_Create |                         6.0.1 | 12,074.12 ns | 103.340 ns | 151.474 ns | 1.3580 |     - |     - |    5720 B |
| TupleDescriptor_Create1 | 6.0.3-tupledescriptor-nocache |     36.58 ns |   0.637 ns |   0.954 ns | 0.0210 |     - |     - |      88 B |
| TupleDescriptor_Create2 | 6.0.3-tupledescriptor-nocache |     62.41 ns |   0.899 ns |   1.317 ns | 0.0248 |     - |     - |     104 B |
| TupleDescriptor_Create3 | 6.0.3-tupledescriptor-nocache |    101.18 ns |   2.270 ns |   3.327 ns | 0.0286 |     - |     - |     120 B |
| TupleDescriptor_Create4 | 6.0.3-tupledescriptor-nocache |    131.02 ns |   2.397 ns |   3.514 ns | 0.0324 |     - |     - |     136 B |
|  TupleDescriptor_Create | 6.0.3-tupledescriptor-nocache |  1,378.13 ns |  14.367 ns |  21.505 ns | 0.1888 |     - |     - |     792 B |

alexyakunin and others added 29 commits March 24, 2020 23:03
# Conflicts:
#	Extensions/Xtensive.Orm.BulkOperations/Internals/ExpressionVisitor.cs
…implify PackedFieldDescriptor implementation
# Conflicts:
#	Orm/Xtensive.Orm/Tuples/Packed/TupleLayout.cs
Comment thread Orm/Xtensive.Orm.Tests.Core/Tuples/TupleBehaviorTestBase.cs Outdated
SergeiPavlov
SergeiPavlov previously approved these changes Apr 2, 2020
Comment thread Orm/Xtensive.Orm/Tuples/Packed/PackedTuple.cs Outdated
@alex-kulakov alex-kulakov merged commit a7749e2 into DataObjects-NET:master Apr 9, 2020
@AlexUstinov AlexUstinov deleted the tupledescriptor-nocache branch April 15, 2020 20:09
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.

4 participants