Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Reducing closure and list allocations in LambdaCompiler - #11326

Merged
VSadov merged 2 commits into
dotnet:masterfrom
bartdesmet:Issue-11323
Sep 7, 2016
Merged

VSadov merged 2 commits into
dotnet:masterfrom
bartdesmet:Issue-11323

Conversation

@bartdesmet

Copy link
Copy Markdown
Contributor

This addresses issue #11323 by:

  • Changing WriteBack delegate to take in LambdaCompiler so the closure doesn't have to include this
  • Splitting AddressOfWriteBack methods by adding a Core method to avoid closure allocation
  • Reducing closure size by reduce the number of locals needed in the write-back
  • Removing cleverness in EmitArray where a callback was used by inlining the logic in its single call site
  • Lazily allocating List<WriteBack> at the point it's needed, using null to represent no write-backs
  • Using List<WriteBack> instead of IList<WriteBack> for foreach so it binds to struct-based GetEnumerator

CC @VSadov

{
ContractUtils.RequiresNotNull(elementType, nameof(elementType));
ContractUtils.RequiresNotNull(emit, nameof(emit));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using issue #11325 to track changes from ContractUtils to Debug asserts where possible. Will make separate PR for this.

@bartdesmet

Copy link
Copy Markdown
Contributor Author

Test Innerloop Windows_NT Debug Build and Test please (ran into one of the issues tracked in #9228)

@VSadov

VSadov commented Sep 6, 2016

Copy link
Copy Markdown
Member

LGTM. Thanks!!
Need to resolve merge conflicts

@bartdesmet

Copy link
Copy Markdown
Contributor Author

Test Innerloop OSX Debug Build and Test please (Build machine went offline during the build.)

@VSadov
VSadov merged commit 8f63260 into dotnet:master Sep 7, 2016
@bartdesmet
bartdesmet deleted the Issue-11323 branch September 7, 2016 03:30
@karelz karelz modified the milestones: 1.1.0, 1.2.0 Dec 3, 2016
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
Reducing closure and list allocations in LambdaCompiler

Commit migrated from dotnet/corefx@8f63260
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants