-
Notifications
You must be signed in to change notification settings - Fork 272
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
Memory and rendering improvements #752
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…e shaper for measuring text
… reverse iterator
…SKColor.Parse(PURPLE)
…ctions, compare case insensitively instead of using string.ToLower
… early if a message is empty
ScrubN
force-pushed
the
memory-improvements
branch
from
July 7, 2023 05:58
ee07236
to
783d5c3
Compare
I don't know why I didn't try spans before using the StringPool, but the difference in performance is insane. The renderer is still bottlenecked by copying to ffmpeg though :( |
… use interpolated string handler format provider instead of ToString
…use custom TryGetTwitchEmote() methods instead of .Any() then .First()
…r and allocate less, cleanup
…Formatted, create ToFormattedString<T>() for custom string formatting without boxing
ScrubN
changed the title
Render speed and memory improvements
Memory and rendering improvements
Jul 11, 2023
Why is string.Create not mentioned more in the docs??
…rd regexes only in the needed scope, rename fields
…imestamp generation almost free, make TimeSpanHFormat.Format faster and allocate less, add non-boxing overload of TimeSpanHFormat.Format
…hing gift-illus.png, return SKImages from HighlightIcons Apparently calling SKCanvas.DrawBitmap with immutable bitmaps and using SKCanvas.DrawImage where possible increase performance
…nto memory-improvements
…ce memory allocated by HTML chat serializer
ScrubN
commented
Jul 31, 2023
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.
I need to stop making 1.5k line change PRs
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SubstringToTextWidth
andGetShapedTextPath
GetShapedTextPath
instead of cloning the fontSubstringToTextWidth
to a faster Skia method when the message does not contain delimiters or RTLGetFallbackFont
IDisposable
onChatRenderer
,TwichEmote
,ChatBadge
, andCheerEmote
to properly dispose of unmanaged resources instead of having to callGC.WaitForPendingFinalizers
HighlightMessage
->HighlightIcons
and make it a private field ofChatRenderer
TwitchEmote
codec values instead of repeatedly making the same extern callsFFmpegProcess
classRemoveRestrictedComments
when there are no restrictionsRemoveRestrictedComments
string.ToLower()
calls intostring.Equals(..., StringComparison.OrdinalIgnoreCase)
StringBuilder.Replace
instead ofstring.Replace
when generating ffmpeg argsHighlightIcons
to use spans to allocate no strings on average and do less redundant checksTwitchEmote
image decoding to throw an exception with a more descriptive messageToString
's with a single formatted interpolated stringSKImageInfo
for each sectionImage for less extern callsTimeSpanHFormat.Format
GetShapedTextPath
toSKPaintExtensions
and cacheSKPaint.GetFont
reflectionStringBuilder
instead of concatenation when compiling message bodiesgift-illus.png
(highlight icon) fetching obey offline statusSKImage
overSKBitmap
for iconsSKCanvas.DrawBitmap
/SKCanvas.DrawImage
by sharing memory handles instead of copying