w3c / w3c/edit-context

EditContext.text can be problematic from performance point of view

Open
#107 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
48
Forks
13
PR merge metrics
No merged PRs in 30d

Description

If the modified text becomes long and the JS side accesses .text regularly, maintaining the string may become slow and also use quite a bit memory and cause lots of memory churn.
On IRC @dandclark suggested
"we'll probably want to add an additional getText()/setText() that take a start index and a length or end index."

Contributor guide

Open the contributing guide

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

Start with the EditContext API and the issue's discussion of regular access to EditContext.text. Review the proposed getText()/setText() methods and their start-index and length or end-index arguments; done requires an agreed API change that addresses string maintenance and memory churn, but no files or tests are named.

Written by the indexing model from the issue text.

Assessment

Tech stack
html, javascript
Domain
api, performance, web-dev
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.