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

Improve performance and reduce memory use and reduce array allocations by reusing char[] #9166

Merged

Conversation

nzdev
Copy link
Contributor

@nzdev nzdev commented Oct 15, 2020

Prerequisites

  • I have added steps to test this contribution in the description below

If there's an existing issue for this PR then this fixes N/A

Description

What?
Introduced Umbraco.Core.Constants.CharArrays.

Replaced instantiations of common char[] by reusing readonly char[]. Also replaced implicit new char[]'s when params char[] methods are called.

Why?
Reduce allocations, reduce memory use, improve performance.

How to test?
Existing tests pass.

Copy link
Contributor

@nathanwoulfe nathanwoulfe left a comment

Choose a reason for hiding this comment

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

Hi @nzdev, I've eyeballed all the file changes, everything looks fine. I see no reason not to make these changes, but pinging @Shazwazza in case he has any input before I merge.

Copy link
Contributor

@Shazwazza Shazwazza left a comment

Choose a reason for hiding this comment

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

Yeah looks good! @nathanwoulfe feel free to merge/tag for next release :)

@Shazwazza Shazwazza added the category/performance Fixes for performance (generally cpu or memory) fixes label Dec 16, 2020
@Shazwazza
Copy link
Contributor

@nathanwoulfe you still ok to merge this one or waiting on something?

@nathanwoulfe
Copy link
Contributor

@Shazwazza absolutely. I think it got lots in my piles of notifications.

@nathanwoulfe nathanwoulfe merged commit 0bd4dce into umbraco:v8/contrib Jan 22, 2021
@umbrabot
Copy link

Hi there @nzdev,

First of all: A big #H5YR for making an Umbraco related contribution during Hacktoberfest! We are very thankful for the huge amount of PRs submitted, and all the amazing work you've been doing 🥇

Due to the amazing work you and others in the community have been doing, we've had a bit of a hard time keeping up. 😅 While all of the PRs for Hacktoberfest might not have been merged yet, you still qualify for receiving some Umbraco swag, congratulations! 🎉

In the spirit of Hacktoberfest we've prepared some exclusive Umbraco swag for all our contributors - including you!

As a new choice this year, you can opt-out of receiving anything and ask us to improve the planet instead by planting a tree on your behalf. 🌳

Receive your swag or plant a tree! 👈 Please follow this link to fill out and submit the form, before February 26, 2021.

Following this date we'll be sending out all the swag, which also means that it might not reach your doorstep before April, so please bear with us and be patient 🙏

The only thing left to say is thank you so much for participating in Hacktoberfest! We really appreciate the help!

Kind regards,
The various Umbraco Teams

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants