-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Memory and rendering improvements (#752)
* Use more spans and references where possible, support reusing the same shaper for measuring text * Don't hide the renderoptions in GetFallbackFont * Minor cleanup * Debug stuff * Implement IDisposable in several types to properly release resources * Cache values instead of making repeated external calls * Misc cleanup * Return highlight icon bitmap reference instead of copy * Use precomputed emote total duration, use reverse for loop instead of reverse iterator * Update FfmpegProcess, remove pointless couple to FfmpegProcess in DriveHelper * Fix potential memory leaks, make less repeated external calls, cache SKColor.Parse(PURPLE) * General cleanup * Short circuit RemoveRestrictedComments if there are no comment restrictions, compare case insensitively instead of using string.ToLower * More case insensitive checks instead of string.ToLower() * Use StringBuilder.Replace instead of String.Replace * Do not render every previous comment when starting at comment index 101 or later * Use a StringPool to cache frequently recreated strings, short circuit early if a message is empty * Move TimeSpanExtensions.cs to TwitchDownloaderCore.Extensions * Forgot to stage * Add success check to TwitchEmote image decoding * More descriptive unsupported chat format exception messages * Use spans instead of StringPool * Fix oversight, only report progress every 3 ticks (less allocations), use interpolated string handler format provider instead of ToString * Cache the SKImageInfo for each sectionImage for less external calls, use custom TryGetTwitchEmote() methods instead of .Any() then .First() * Fix a few more minor memory leaks, refactor bits checking to be faster and allocate less, cleanup * Reduce allocations made by TimeSpanHFormat.Format and TaskData.LengthFormatted, create ToFormattedString<T>() for custom string formatting without boxing * Use string.Create instead of a custom extension method Why is string.Create not mentioned more in the docs?? * Less allocations when serializing plain text chats * Move GetShapedTextPath to SKPaintExtensions, cache SKPaint.GetFont reflection * Use StringBuilder to build downloaded message bodies, store banned word regexes only in the needed scope, rename fields * Fix ChatRender timestamps resetting after 24 hours, make ChatRender timestamp generation almost free, make TimeSpanHFormat.Format faster and allocate less, add non-boxing overload of TimeSpanHFormat.Format * Explicitly set immutable bitmaps as immutable, obey offline when fetching gift-illus.png, return SKImages from HighlightIcons Apparently calling SKCanvas.DrawBitmap with immutable bitmaps and using SKCanvas.DrawImage where possible increase performance * Fix potential timecode parsing crash * More efficient chat text Utc formatting * Cleanup * Reduce GC footprint of BufferExtensions.Add * Make ChatBadge bitmaps immutable * Explicitly make local functions static * Fix message timestamp resetting after 24 hours in HTML chats and reduce memory allocated by HTML chat serializer * Fix minor spacing issue * Make ParseCommentBadges more readable
- Loading branch information
Showing
34 changed files
with
1,077 additions
and
577 deletions.
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.