mirror of
https://github.com/xoofx/markdig.git
synced 2026-02-03 21:36:36 +00:00
[PR #650] [MERGED] Remove some branches in HtmlHelper.TryParseHtmlTagOpenTag by using bitmask #1165
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/xoofx/markdig/pull/650
Author: @gfoidl
Created: 7/21/2022
Status: ✅ Merged
Merged: 8/12/2022
Merged by: @xoofx
Base:
master← Head:htmlhelper-TryParseHtmlTagOpenTag_remove_branches📝 Commits (1)
bfd7b64Remove some branches in HtmlHelper.TryParseHtmlTagOpenTag by using bitmasks📊 Changes
1 file changed (+40 additions, -2 deletions)
View changed files
📝
src/Markdig/Helpers/HtmlHelper.cs(+40 -2)📄 Description
Eliminate some branches in
HtmlHelper.TryParseHtmlTagOpenTag(due to||comparisons) by using a bitmask approach instead.Further the generated machine code has a
test jump-combo, which allows optimizations at cpu-level (macro fusion, etc.).Other places in that type seem not worthwile, as the count of
cmps can't be lowered that the current count is.Benchmarks
The benchmarks are done on a trimmed-down version of the code, to just test these parts of the code changed.
IsSpaceOrSpecialHtmlChar
benchmark code
IsCharToAppend
benchmark code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.