question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Builtin webworker support and debounce support

See original GitHub issue

Description

When many extensions is mounted on the Editor instance, for example, like some extension that includes some complex work, such as computing tasks like regular matching even I/O tasks like HTTP Request, in my case, extensions with 10+ regular matching tasks, could cost 62ms to run on relatively largely documents(eg. 2000+ words) after every input event.

Possible solutions

For now, I want to debounce the builtin transaction( or document update) event that creates a new state on old state, which means the transaction could be dispatched after users stop typing. Or another solution is to run the complex and time-consuming work in webworker or background so that it would not block the main UI thread, yes, like vscode does, which enables linter, formater, hignlighting run in background.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
Alecyruscommented, May 7, 2019

I will work on it with a practical benchmark later…

0reactions
growupanandcommented, Feb 19, 2022

I was using debounce from lodash, which was not async supported so it was not working before.

Now i switch to debounce from awesome-debounce-promise , which support async and now it is working.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Javascript Web Worker - How to ignore all messages except ...
How about using debounce ? It delays the processing for a bit, and if a new message is received during that delay, it...
Read more >
Web workers are not the answer | Dagster Blog
A tale of overstretched logs, counterintuitive web worker behavior, and ultimately a troublesome cursor issue.
Read more >
Community links - Apollo GraphQL Docs
Link Author Description apollo‑angular‑link‑http @kamilkisiela An HTTP link for use with Apollo Angular. apollo‑link‑token‑refresh @newsiberian Performs expired JWT renewal. link‑http‑dataloader @graphcool Batching and caching provided by...
Read more >
Adding Debounce to the Typeahead - Medium
Let's see how the vanilla snippet fares when adding debouncing: ... and cutting-edge topics to help you practice your craft and accelerate your...
Read more >
Introducing WebSockets - Bringing Sockets to the Web
Introducing Web Workers: Bring Threading to JavaScript # ... The latest versions of the modern browsers support passing a JSON object.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found