Skip to content

[Bug]: Immense Lag when typing #168

@audenh

Description

@audenh

Bug Description

Hiya! I love this plugin, and I can't wait to see it get more popular (got straight A's for finals!!!!)

I noticed some immense lag when I'm typing, specifically when there's a lot of text all at once. The culprit is LearnKit. Looking at the code in dev tools, it brought me to column 52118, which seems to correspond with

const scheduleModeScan = () => {

I have very little JavaScript knowledge, but this does seem to be the culprit as I have been able to reproduce this on completely clean vaults.

When you have other plugins that also use similar listeners, the lag becomes even worse, to the point where the editor is unresponsive for a few seconds.

Attached is the performance profiler.

Please let me know if I can do anything else! This plugin is awesome and I would love to help it grow :)

Image Image

Steps to Reproduce

  1. Install LearnKit (I think I'm on latest 1.5.3?)
  2. Create a new note
  3. Install other plugins like Notebook Navigator that also utilize listeners (THIS STEP IS OPTIONAL!)
  4. Switch to live preview OR source
  5. Spam a lot of text (probably dozens of characters per second)
  6. Your editor will become unresponsive

Expected Behavior

No lag :(

LearnKit Version

1.5.3

Obsidian Version

1.12.7

Operating System

Windows

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions