[PR #622] [MERGED] Vectorize CharacterMap.IndexOfOpeningCharacter #1146

Open
opened 2026-01-29 14:50:25 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/xoofx/markdig/pull/622
Author: @MihaZupan
Created: 4/15/2022
Status: Merged
Merged: 4/20/2022
Merged by: @xoofx

Base: masterHead: simd-character-map


📝 Commits (1)

  • da756f4 Vectorize CharacterMap.IndexOfOpeningCharacter

📊 Changes

1 file changed (+85 additions, -0 deletions)

View changed files

📝 src/Markdig/Helpers/CharacterMap.cs (+85 -0)

📄 Description

A 1-2.5% improvement for parsing (on x86 LE hardware only for now)

For long runs without an opening character, the vectorized loop is ~8x faster.

Method AdvancedPipeline Mean Error StdDev Median
Parse False 262.6 us 0.73 us 3.64 us 263.5 us
Parse True 366.9 us 0.43 us 2.16 us 367.2 us
Method AdvancedPipeline Mean Error StdDev
Parse False 259.5 us 0.18 us 0.91 us
Parse True 357.9 us 0.41 us 2.06 us

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/xoofx/markdig/pull/622 **Author:** [@MihaZupan](https://github.com/MihaZupan) **Created:** 4/15/2022 **Status:** ✅ Merged **Merged:** 4/20/2022 **Merged by:** [@xoofx](https://github.com/xoofx) **Base:** `master` ← **Head:** `simd-character-map` --- ### 📝 Commits (1) - [`da756f4`](https://github.com/xoofx/markdig/commit/da756f4efe7b5ee6999ef753a2fd4fb9387172dd) Vectorize CharacterMap.IndexOfOpeningCharacter ### 📊 Changes **1 file changed** (+85 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/Markdig/Helpers/CharacterMap.cs` (+85 -0) </details> ### 📄 Description A 1-2.5% improvement for parsing (on x86 LE hardware only for now) For long runs without an opening character, the vectorized loop is ~8x faster. | Method | AdvancedPipeline | Mean | Error | StdDev | Median | |------- |----------------- |---------:|--------:|--------:|---------:| | Parse | False | 262.6 us | 0.73 us | 3.64 us | 263.5 us | | Parse | True | 366.9 us | 0.43 us | 2.16 us | 367.2 us | | Method | AdvancedPipeline | Mean | Error | StdDev | |------- |----------------- |---------:|--------:|--------:| | Parse | False | 259.5 us | 0.18 us | 0.91 us | | Parse | True | 357.9 us | 0.41 us | 2.06 us | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 14:50:25 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#1146