Issue 237433 in chromium: Editing textarea with lots of text is slow

441 views
Skip to first unread message

chro...@googlecode.com

unread,
May 2, 2013, 1:06:42 AM5/2/13
to chromi...@chromium.org
Status: Available
Owner: ----
CC: ba...@chromium.org, tk...@chromium.org, nba...@chromium.org,
kenji...@chromium.org
Labels: Type-Bug Pri-2 OS-All Cr-Blink Cr-Blink-Editing Cr-Blink-Forms
Cr-Blink-Performance

New issue 237433 by nba...@chromium.org: Editing textarea with lots of text
is slow
http://code.google.com/p/chromium/issues/detail?id=237433

Splitting off from Issue 109587
Attaching (slightly edited) reproduction from
https://code.google.com/p/chromium/issues/detail?id=109587#c4

For reference, can generate a textarea with long text via these commands:
echo '<textarea rows=30 cols=80>' > /tmp/longtext.html
for i in {1..80000} ; do echo 'foo' >> /tmp/longtext.html ; done
echo '</textarea> >> /tmp/longtext.html

Description:
Editing a textarea with lots of text is noticeably slow.
Open up attached test case in Firefox and in Chrome.
Once loaded, navigation in Firefox is instant, but navigation in Chrome
(up, down, left, right, home, end, Ctrl-home, Ctrl-end) are slow, lagging
by about a second.
Deletes and inserts (backspace and typing) are also slow in Chrome; slight
lag in Firefox, but virtually none.

Cause:
Presumably there are some algorithms in the navigation/editing code which
are O(n) in the number of lines or number of characters in the textarea,
which need to be O(1) to be scaleable.

Attachments:
textarea-with-long-text.html 4.6 MB

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

chro...@googlecode.com

unread,
May 2, 2013, 1:12:42 AM5/2/13
to chromi...@chromium.org

Comment #1 on issue 237433 by nba...@chromium.org: Editing textarea with
Note also that several bulk operations are also slow, which may be related.
Bulk selecting and bulk clearing are covered at:
Issue 163131: Clearing a textarea which contains a large amount of text is
extremely slow
Bulk paste is covered at:
Issue 109587: Pasting lots of text to a textarea is slow

chro...@googlecode.com

unread,
May 2, 2013, 5:45:27 AM5/2/13
to chromi...@chromium.org
Updates:
Labels: Hotlist-Fixit

Comment #2 on issue 237433 by kenji...@chromium.org: Editing textarea
(No comment was entered for this change.)

chro...@googlecode.com

unread,
May 2, 2013, 5:47:27 AM5/2/13
to chromi...@chromium.org

Comment #3 on issue 237433 by nba...@chromium.org: Editing textarea with
Some real-world examples, from Wikipedia's long pages:
http://en.wikipedia.org/wiki/Special:LongPages
http://en.wikipedia.org/wiki/List_of_United_States_counties_and_county-equivalents
http://en.wikipedia.org/wiki/List_of_Advanced_Dungeons_%26_Dragons_2nd_edition_monsters
For these, navigating at the top of the edit area is fast for me, but at
the bottom of the page has visible lag.

chro...@googlecode.com

unread,
May 18, 2013, 10:55:04 PM5/18/13
to chromi...@chromium.org

Comment #5 on issue 237433 by john.pgr...@gmail.com: Editing textarea with
I found that after cutting off all contents and pasting them back to the
textarea, the response becomes normal.
I'm guessing maybe it's related to multiple thread handling?
so i have a try on this way to try to work around it, and it works!
//
// $("textarea").val(content); // ## this is original code
window.setTimeout(function () { $("textarea").val(content); }, 0);

chro...@googlecode.com

unread,
Apr 16, 2014, 8:10:14 AM4/16/14
to chromi...@chromium.org

Comment #7 on issue 237433 by ksschwar...@googlemail.com: Editing textarea
Problem still exists, chromium Version 33.0.1750.152 Ubuntu 12.04 (256984)
This works for other browsers in current version (IE, FF, Safari)

chro...@googlecode.com

unread,
Oct 21, 2014, 11:37:38 PM10/21/14
to chromi...@chromium.org

Comment #9 on issue 237433 by nik...@gmail.com: Editing textarea with lots
of text is slow
https://code.google.com/p/chromium/issues/detail?id=237433

In Chrome a large textarea works better when the cursor is at the top.
When you go down to the bottom it's very slow.

Even IE 8 is faster than the latest Chrome.

The CPU is at <20% when I'm scrolling around textarea in Firefox. In
chrome it's >90%


Using Chrome 37.0.2062.120

chro...@googlecode.com

unread,
Nov 24, 2014, 11:48:00 PM11/24/14
to chromi...@chromium.org

Comment #11 on issue 237433 by ko...@chromium.org: Editing textarea with
lots of text is slow
https://code.google.com/p/chromium/issues/detail?id=237433

As far as we examined, the bad case is limited only when the text contains
a lot of newlines. Large text without newlines look ok.

chro...@googlecode.com

unread,
Jun 14, 2015, 8:47:16 AM6/14/15
to chromi...@chromium.org

Comment #13 on issue 237433 by slipknot...@hotmail.fr: Editing textarea
with lots of text is slow
https://code.google.com/p/chromium/issues/detail?id=237433

Same issue with small text (1 word) backspace is very slow in chrome 41

chro...@googlecode.com

unread,
Oct 6, 2015, 5:39:27 AM10/6/15
to chromi...@chromium.org

Comment #16 on issue 237433 by se...@google.com: Editing textarea with lots
of text is slow
https://code.google.com/p/chromium/issues/detail?id=237433

I had an issue like this, and it helped a lot (think 100x) to turn off
spelling correction (via right-click on the field).

chro...@googlecode.com

unread,
Jan 28, 2016, 3:48:05 AM1/28/16
to chromi...@chromium.org

Comment #17 on issue 237433 by phistuck: Editing textarea with lots of text
is slow
https://code.google.com/p/chromium/issues/detail?id=237433

data:text/html,<!doctype html><textarea cols=100
rows=40>a</textarea><script>document.querySelector("textarea").value
= "a".repeat(1042833);</script>
Slow as hell. :( No new lines (text wrapping is enabled, though).
Reply all
Reply to author
Forward
0 new messages