-
Notifications
You must be signed in to change notification settings - Fork 248
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
Reduce Allocations #821
Reduce Allocations #821
Conversation
@BobLd Ready for review. |
private static readonly PlainTokenizer PlainTokenizer = new PlainTokenizer(); | ||
private static readonly NumericTokenizer NumericTokenizer = new NumericTokenizer(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are thread safe now and can be reused.
@iamcarbon UglyToad.PdfPig.Fonts is missing the following:
|
Can you give more background about |
There's a few caveats to using ValueStringBuilder:
With the caveats mentioned:
I'd make a case for using it nearly everywhere where the values are small or we are fairly confident in choosing the initial buffer size, and that doesn't make any use of advanced StringBuilder cases. It makes a nice dent in reducing allocations. |
This PR: