Skip to content

Using ArrayPool for AssocTable#8234

Merged
cartermp merged 4 commits into
dotnet:masterfrom
TIHan:opt/arraypool1
Jan 17, 2020
Merged

Using ArrayPool for AssocTable#8234
cartermp merged 4 commits into
dotnet:masterfrom
TIHan:opt/arraypool1

Conversation

@TIHan

@TIHan TIHan commented Jan 16, 2020

Copy link
Copy Markdown
Contributor

Uses ArrayPool for AssocTable since we are allocating a large int array every time we want to parse anything.
Untitled

Comment thread src/utils/prim-parsing.fs
let reductions = tables.reductions
let actionTable = new AssocTable(tables.actionTableElements, tables.actionTableRowOffsets)
let gotoTable = new AssocTable(tables.gotos, tables.sparseGotoTableRowOffsets)
let cacheSize = 7919 // the 1000'th prime

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lol what?

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.

I have no idea :) - I just copied what was there.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

fair enough

Comment thread src/utils/prim-lexing.fs Outdated

@cartermp cartermp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Style nits, one of which should impact debuggability I think.

we are allocating a large int array every time we want to parse anything.

Is there some trace data or benchmark that shows the impact of this?

Comment thread src/utils/prim-parsing.fs Outdated
Comment thread src/utils/prim-parsing.fs Outdated
Comment thread src/utils/prim-parsing.fs Outdated
@TIHan

TIHan commented Jan 16, 2020

Copy link
Copy Markdown
Contributor Author

@cartermp Added trace data

@baronfel

Copy link
Copy Markdown
Member

tagging myself so I can know to wait for this before releasing the next FCS.

@cartermp cartermp mentioned this pull request Jan 16, 2020
10 tasks
@cartermp cartermp merged commit 88c7a2b into dotnet:master Jan 17, 2020
@cartermp cartermp mentioned this pull request Sep 6, 2020
4 tasks
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Feb 23, 2021
* Using ArrayPool

* Remove open

* Changed some style nits

* Clear arrays
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.

5 participants