IppClub / IppClub/YueScript

Adding '{' makes code run exponentially slow.

Open
#120 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
613
Forks
45
PR merge metrics
No merged PRs in 30d

Description

Just an interesting thing that I found. It seems that continuously adding '{' doubles execution time with each '{' and also consumes 100% CPU while running. Not sure if this should be treated as a bug or not.

Long backtrace of running {{{{{{{{{{{{{{{{{{ (thats 18 '{'):

https://gist.github.com/nm17/ed64b33f838a97c1285aa5ef1229eab0

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.

Research direction

Reproduce the reported slowdown with the 18-character {{{{{{{{{{{{{{{{{{ input and review the linked backtrace gist first. Trace where repeated { characters are processed and verify that execution no longer grows exponentially or consumes 100% CPU.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
compilers
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.