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: FormsAssignee: 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
Reported 2022-11-10 09:05:08 PST
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
Ahmad Saleem
Comment 1 2022-11-10 09:09:33 PST
JSFiddle - https://jsfiddle.net/gxpajusr/1/ Benchmark (textarea-dom.html) mentioned by Blink commit, which improved the performance.
Alexey Proskuryakov
Comment 2 2022-11-10 09:16:39 PST
Chrome is substantially faster on this microbenchmark - and became ~2x faster since this 2015 commit.
Darin Adler
Comment 3 2022-11-10 09:40:18 PST
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
Comment 4 2022-11-10 16:35:23 PST
Darin Adler
Comment 5 2022-11-10 17:47:24 PST
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
Comment 6 2022-11-11 14:13:55 PST
EWS
Comment 7 2022-11-11 17:09:38 PST
Committed 256596@main (610bbdbf42f2): <https://commits.webkit.org/256596@main> Reviewed commits have been landed. Closing PR #6411 and removing active labels.
Note You need to log in before you can comment on or make changes to this bug.