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!
JSFiddle - https://jsfiddle.net/gxpajusr/1/ Benchmark (textarea-dom.html) mentioned by Blink commit, which improved the performance.
Chrome is substantially faster on this microbenchmark - and became ~2x faster since this 2015 commit.
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.
<rdar://problem/102218029>
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.
Pull request: https://github.com/WebKit/WebKit/pull/6411
Committed 256596@main (610bbdbf42f2): <https://commits.webkit.org/256596@main> Reviewed commits have been landed. Closing PR #6411 and removing active labels.