microsoft / microsoft/Tokenizer

Tokenizing a file with a lot of nested open arrays takes almost a minute

Open
#55 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
213
Forks
37
Avg merge
5d 1h
Merged PRs (30d)
5

Description

When tokenizing the files in the https://github.com/Kotlin/kotlinx.serialization repo, the cl100k_base tokenizer struggled on the following files:

While the rest of the files usually took less than a millisecond.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce tokenization using formats/json-tests/jvmTest/resources/spec_cases/n_structure_open_array_object.json and n_structure_100000_opening_arrays.json from the linked Kotlin repository, comparing them with the sub-millisecond files. Trace the tokenizer entry point to identify why deeply nested open arrays are slow; done means these files no longer take seconds to tokenize without changing tokenization results.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
performance, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.