Skip to content

Commit 780b5f0

Browse files
committed
Reduce allocations
The structure of getting a `PortableExecutableReference` meant that we were essentially paying for `byte[]` twice. The first is generating the `byte[]` for the resource and then when that was passed to `CreateFromImage` it was converted to an `ImmutableArray<byte>` which means there is yet another `byte[]` allocation. To avoid this the code now just directly allocates the `ImmutableArray<byte>` and passes that to `CreateFromImage`. This can save up to 45MB in certain cases I was looking at in the Roslyn tests.
1 parent 3865c99 commit 780b5f0

File tree

26 files changed

+3056
-3048
lines changed

26 files changed

+3056
-3048
lines changed

Src/Basic.Reference.Assemblies.AspNet80/Generated.cs

Lines changed: 301 additions & 301 deletions
Large diffs are not rendered by default.

Src/Basic.Reference.Assemblies.AspNet90/Generated.cs

Lines changed: 302 additions & 302 deletions
Large diffs are not rendered by default.

Src/Basic.Reference.Assemblies.Net20/Generated.cs

Lines changed: 49 additions & 49 deletions
Large diffs are not rendered by default.

Src/Basic.Reference.Assemblies.Net35/Generated.cs

Lines changed: 102 additions & 102 deletions
Large diffs are not rendered by default.

Src/Basic.Reference.Assemblies.Net40/Generated.cs

Lines changed: 116 additions & 116 deletions
Large diffs are not rendered by default.

Src/Basic.Reference.Assemblies.Net461/Generated.cs

Lines changed: 186 additions & 186 deletions
Large diffs are not rendered by default.

Src/Basic.Reference.Assemblies.Net472/Generated.cs

Lines changed: 235 additions & 235 deletions
Large diffs are not rendered by default.

Src/Basic.Reference.Assemblies.Net50/Generated.cs

Lines changed: 152 additions & 152 deletions
Large diffs are not rendered by default.

Src/Basic.Reference.Assemblies.Net60/Generated.cs

Lines changed: 159 additions & 159 deletions
Large diffs are not rendered by default.

Src/Basic.Reference.Assemblies.Net60Windows/Generated.cs

Lines changed: 47 additions & 47 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)