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

@TIHanTIHan 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

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
ContributorAuthor

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 threadsrc/utils/prim-lexing.fs Outdated

@cartermpcartermp 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 threadsrc/utils/prim-parsing.fs Outdated
Comment threadsrc/utils/prim-parsing.fs Outdated
Comment threadsrc/utils/prim-parsing.fs Outdated
@TIHan

Copy link
Copy Markdown
ContributorAuthor

@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.

@cartermpcartermp mentioned this pull request Jan 16, 2020
10 tasks
@cartermp
cartermp merged commit 88c7a2b into dotnet:masterJan 17, 2020
@cartermpcartermp 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 freeto 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

@TIHan@baronfel@forki@smoothdeveloper@cartermp