[PR #388] [CLOSED] Optimized LineReader using string.IndexOfAny #979

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

📋 Pull Request Information

Original PR: https://github.com/xoofx/markdig/pull/388
Author: @KrisVandermotten
Created: 1/21/2020
Status: Closed

Base: masterHead: linereader


📝 Commits (1)

  • 111d6fd Optimized LineReader using string.IndexOfAny

📊 Changes

1 file changed (+20 additions, -21 deletions)

View changed files

📝 src/Markdig/Helpers/LineReader.cs (+20 -21)

📄 Description

The LineReader struct is responsible for parsing source text into lines.

Given that String.IndexOfAny is now vectorized, it makes sense to use it instead of the handwritten, unoptimized loop in LineReader.ReadLine().


🔄 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/388 **Author:** [@KrisVandermotten](https://github.com/KrisVandermotten) **Created:** 1/21/2020 **Status:** ❌ Closed **Base:** `master` ← **Head:** `linereader` --- ### 📝 Commits (1) - [`111d6fd`](https://github.com/xoofx/markdig/commit/111d6fd991065f8f7c26ffb9329641d07350a7a1) Optimized LineReader using string.IndexOfAny ### 📊 Changes **1 file changed** (+20 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `src/Markdig/Helpers/LineReader.cs` (+20 -21) </details> ### 📄 Description The `LineReader` struct is responsible for parsing source text into lines. Given that `String.IndexOfAny` [is now vectorized](https://source.dot.net/#System.Private.CoreLib/String.Searching.cs,cf166f50515b56ae), it makes sense to use it instead of the handwritten, unoptimized loop in `LineReader.ReadLine()`. --- <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:48:06 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#979