Bug 247739
| Summary: | Setting the value of a textarea is much slower in WebKit than it is in Chromium | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Ahmad Saleem <ahmad.saleem792> |
| Component: | Forms | Assignee: | Darin Adler <darin> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | ap, bfulgham, cdumez, darin, msaboff, rniwa, webkit-bug-importer, wenson_hsieh |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Ahmad Saleem
Hi Team,
I cam across one potential performance optimization in Blink, which can be used in Webkit but unfortunately, it does not have any testcase to confirm.
Blink Commit - https://chromium.googlesource.com/chromium/blink/+/c70fbd89e637c6fbd7bfeb17e6f5b2ff2dae6f16
Webkit GitHub Source - https://github.com/WebKit/WebKit/blob/7cbae1c1f4b5ae8a346085fb9e543746d39c9bd8/Source/WTF/wtf/text/WTFString.h#LL166
and
https://github.com/WebKit/WebKit/blob/7cbae1c1f4b5ae8a346085fb9e543746d39c9bd8/Source/WTF/wtf/text/WTFString.h#L145
I can do PR but I don't have any testcase etc. to confirm whether it is good change for Webkit or not. Hence, I am hesitant and would add others to confirm whether we should this change or not.
Thanks!
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Ahmad Saleem
JSFiddle - https://jsfiddle.net/gxpajusr/1/
Benchmark (textarea-dom.html) mentioned by Blink commit, which improved the performance.
Alexey Proskuryakov
Chrome is substantially faster on this microbenchmark - and became ~2x faster since this 2015 commit.
Darin Adler
I’ll take a look at the microbenchmark. I think I have a different idea how to speed it up, but I may end up doing the same thing they did in Chromium.
Radar WebKit Bug Importer
<rdar://problem/102218029>
Darin Adler
String::contains is already quite well optimized. We would save almost nothing by specializing it for 8-bit character input. However, the makeStringBySimplifyingNewLines function can be made much more efficient.
Darin Adler
Pull request: https://github.com/WebKit/WebKit/pull/6411
EWS
Committed 256596@main (610bbdbf42f2): <https://commits.webkit.org/256596@main>
Reviewed commits have been landed. Closing PR #6411 and removing active labels.