Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notebook KCL file causing noticeable slowdown #5802

Open
jgomez720 opened this issue Mar 13, 2025 · 2 comments
Open

Notebook KCL file causing noticeable slowdown #5802

jgomez720 opened this issue Mar 13, 2025 · 2 comments
Assignees

Comments

@jgomez720
Copy link
Collaborator

Description

Something within the notebook file is causing a noticeable slowdown.

Version

v0.47.0

KCL

notebook.zip

Recordings

Screenshare.-.2025-03-13.3_26_19.PM.mp4
@jgomez720
Copy link
Collaborator Author

@nrc feel free to reassign. I've seen you are the performance guru.

@nrc
Copy link
Contributor

nrc commented Mar 16, 2025

Logging some investigation:

  • running from the command line, the project doesn't take a huge amount of time to run (though certainly not quick): interpretation time is 2.5-3s, parsing time is under 25ms for each file.
  • It's creating 111 memory environments, which is quite a few, but not ridiculous
  • It is certainly a terrible experience in the app
  • Playing with the code, it seems to be pattern-transforming the paper 100x which is causing the issue
  • And back to measuring - changing from 1 to 100 to 1000 repeats changes from roughly 2 to 3 to 4.5s, so not quite proportional, but impacting performance. The ProgramMemory stats are clearly affected by the number of repeats here
  • The commands sent to the engine are not affected by the number of repeats - it's just a single command (as expected)
  • We are not calling into KCL on every frame of animation, so I think this isn't a KCL issue. I did some casual profiling in the app and nothing jumped out as suspicious (though I'm no expert on JS profiling). So, my current hypothesis is that this is an engine issue and due to the high number of instances in the pattern transform in paper.kcl, reassigning to @gserena01

@nrc nrc assigned gserena01 and unassigned nrc Mar 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants