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

Provide allocate-less overloads of methods in SKTextBlobBuilder #2664

Closed
wants to merge 1 commit into from

Conversation

Youssef1313
Copy link

@Youssef1313 Youssef1313 commented Nov 3, 2023

In Uno Platform, we are using AllocatePositionedRun, which in some scenarios can be problematic as it's allocating and it's in a hot path. See for example this is a case where this was responsible for 11.3% of all allocations.

image

The idea here is to introduce a new API that won't allocate SKPositionedRunBuffer and instead give us the Spans that we need right away. I have made the same change to APIs other than AllocatePositionedRun for parity.

@Gillibald
Copy link
Contributor

Why aren't you changing SKRunBuffer to a readonly struct?

@Youssef1313
Copy link
Author

@Gillibald Avoiding breaking changes

@Gillibald
Copy link
Contributor

This can be a breaking change for V3

@mattleibow
Copy link
Contributor

This sort of came to me #2775

Let me know if this is useful and leave comments/suggestions.

@mattleibow
Copy link
Contributor

mattleibow commented Mar 27, 2024

Thanks for this PR.

Closing this in favour of #2775

Since this API will be 3.0+ and the whole way the build works is different, the current API was mostly wrong. Hopefully the 3.x APIs are better to use.

@mattleibow mattleibow closed this Mar 27, 2024
@Youssef1313 Youssef1313 deleted the performant-alternative branch March 27, 2024 20:50
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.

Provide allocation-free overloads of methods in SKTextBlobBuilder
3 participants