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

Using ArrayPool for AssocTable #8234

Merged
merged 4 commits into from Jan 17, 2020
Merged

Using ArrayPool for AssocTable #8234

merged 4 commits into from Jan 17, 2020

Conversation

TIHan
Copy link
Member

@TIHan TIHan commented Jan 16, 2020

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

@@ -234,8 +231,14 @@ module internal Implementation =
let ruleValues = (Array.zeroCreate 100 : obj[])
let lhsPos = (Array.zeroCreate 2 : Position[])
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
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
Member 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
Contributor

Choose a reason for hiding this comment

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

fair enough

src/utils/prim-lexing.fs Outdated Show resolved Hide resolved
Copy link
Contributor

@cartermp cartermp left a comment

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?

src/utils/prim-parsing.fs Outdated Show resolved Hide resolved
src/utils/prim-parsing.fs Outdated Show resolved Hide resolved
src/utils/prim-parsing.fs Outdated Show resolved Hide resolved
@TIHan
Copy link
Member Author

TIHan commented Jan 16, 2020

@cartermp Added trace data

@baronfel
Copy link
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.

None yet

5 participants