microsoft / microsoft/Tokenizer
Tokenizing a file with a lot of nested open arrays takes almost a minute
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:
- n_structure_open_array_object.json took 53.7s to tokenize
- n_structure_100000_opening_arrays.json took 6.9s to tokenize
While the rest of the files usually took less than a millisecond.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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