Remove string allocations by kerams · Pull Request #9718 · dotnet/fsharp · GitHub
Skip to content

Remove string allocations - #9718

Merged
cartermp merged 1 commit into
dotnet:masterfrom
kerams:patch-2
Jul 21, 2020
Merged

cartermp merged 1 commit into
dotnet:masterfrom
kerams:patch-2

Conversation

@kerams

@kerams kerams commented Jul 19, 2020

Copy link
Copy Markdown
Contributor

No description provided.

@cartermp

cartermp commented Jul 20, 2020 •

Copy link
Copy Markdown
Contributor

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

Great changes, thanks!

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

The changes look good, but I would like to see more information regarding these changes.

Do the changes actually give a measurable performance improvement in the overall tooling? Can you provide evidence?

Also, more description of the PR would be helpful too instead of it being empty.

Normally I would 'request changes', but since this isn't touching the internals of the compiler - I can be a bit more relaxed.

@TIHan

TIHan commented Jul 20, 2020

Copy link
Copy Markdown
Contributor

To note: The only reason why I made the comment that I did was because we have to use AsSpan and depending on the case, can make me a little nervous in terms of readability if we start doing that everywhere.

@kerams

kerams commented Jul 20, 2020

Copy link
Copy Markdown
Contributor Author

I was just browsing the repo and noticed these things could be improved, so that's what I did thinking any performance uplift (and I'm pretty sure this change will have a completely negligible impact on its own) is better than nothing, admittedly with no regard to readability. That's all there is to say, really ;)

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

These are good changes. I agree the perf improvements will be minuscule, we normally try to avoid drive-by churn because of unintended consequences, however, these look focused enough that the risk is pretty low.

Thank you for taking care of this

Kevin

@cartermp

Copy link
Copy Markdown
Contributor

These changes may not actually be miniscule - one of these cases removes a new string allocation for every single span of text we classify in a document. For large documents that could be meaningful.

@kerams

kerams commented Jul 21, 2020

Copy link
Copy Markdown
Contributor Author

@cartermp, how would one go about measuring the difference on a sizeable file/codebase?

@cartermp

Copy link
Copy Markdown
Contributor

@cartermp
cartermp merged commit 77d9e23 into dotnet:master Jul 21, 2020
@kerams
kerams deleted the patch-2 branch July 22, 2020 05:42
@kerams
kerams restored the patch-2 branch July 25, 2020 07:36
@kerams
kerams deleted the patch-2 branch July 25, 2020 07:37
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Feb 23, 2021
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Jan 26, 2022
nosami pushed a commit to xamarin/visualfsharp that referenced this pull request Jan 26, 2022
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.

4 participants