Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

perf: fix O(n²) string concatenation in parseStr (Tokenizer.lean)

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

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
58/100
Issue type
Refactor
Clarity
Clearly specified
Activity status
Stale

Research direction

Open Lck/Json/Tokenizer.lean and inspect parseStr, especially its accumulator and close-quote branch. Replace the repeated string concatenation with one of the suggested linear-time accumulation approaches, while preserving parsing behavior and confirming that large strings no longer trigger O(n²) work.

Written by the indexing model from the issue text.

Description

Problem

parseStr in Lck/Json/Tokenizer.lean accumulates the string result with acc ++ s, which is O(n²) for large strings because each concatenation copies the accumulated string.

Suggested Fix

Use String.Builder accumulation or collect into List Char/List String and concatenate once at the close-quote branch to achieve O(n) behavior.

References

Raised in AI code review (Codex #1, medium severity).

Dominant language
Lean
Stars
2
Forks
1
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

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.

More from lambdaclass/lambda_compiler_kit

All issues in lambdaclass/lambda_compiler_kit

Similar issues

More Compilers issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.