Add efficient findCharIndex
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 30/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- haskell
- 領域
- performance
調査の方向性
まず #369 の関連する議論を読み、既存の findIndex と isSubsequenceOf の経路を追ってください。Issue ではソースファイルやテストが指定されていません。完了するには、プリミティブについて合意し、提案されている Char の書き換え規則と UTF-8 の検索動作を評価する必要があります。
索引モデルが issue の本文から書いたものです。
説明
findCharIndex :: Char -> Text -> Maybe Int
When having look at #369, it looks like having access to this primitive, with a fast C implementation that uses the known size of each char in utf-8 might be able to make isSubsequenceOf quite fast, particularly when the haystack is quite large and the needle chars are spread far apart.
int findCharIndex(const char * haystack, int length, int target) {
char * offset;
if (target < 128) {
offset = memchr(haystack, length target);
} else {
// Implementation left as an exercise to the reader, but it would look for
// utf-8 encoded bytes for the Char.
offset = efficientlyFindUTF8Codepoint(haystack, length, target);
}
if (offset == NULL) return -1;
return (int)(offset - haystack);
}
Having this also means we could add the rule
{-# RULES "findIndex Char" findIndex (c ==) = findCharIndex c #-}
{-# RULES "findIndex Char2" findIndex (== c) = findCharIndex c #-}
- 主要言語
- Haskell
- スター
- 424
- フォーク
- 167
- 平均マージ
- 1日 21時間
- マージ済み PR(30日)
- 6
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
haskell/text のほかの issue
-
Relax constraints on decimal / hexadecimal from Data.Text.Read and Data.Text.Lazy.Read対応中かも @Lysxia が 148 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 64/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 38/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 45/100
-
Shrinking is Insanely Slow for `write_read`対応中かも @BebeSparkelSparkel が 926 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 30/100
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
haskell/bytestring#730 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
seal-harness/seal-harness#399 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
fmidue/codeworld-tasks#124 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
reflex-frp/reflex#563 ·