| Summary: | Improve performance by using StringView, not "const StringView&" | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Darin Adler <darin> | ||||||
| Component: | Web Template Framework | Assignee: | Darin Adler <darin> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | andersca, benjamin, cdumez, changseok, cmarcelo, dbarton, dino, eric.carlson, esprehn+autocc, ews-watchlist, fmalita, fred.wang, glenn, gyuyoung.kim, jer.noble, keith_miller, kondapallykalyan, mark.lam, mifenton, mmaxfield, msaboff, pdr, philipj, saam, sabouhallawa, schenney, sergio, tzagallo, webkit-bug-importer | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | All | ||||||||
| OS: | All | ||||||||
| Attachments: |
|
||||||||
|
Description
Darin Adler
2021-09-02 15:30:03 PDT
Created attachment 437204 [details]
Patch
Comment on attachment 437204 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=437204&action=review > Source/WTF/ChangeLog:11 > + Since StringView is a small structure that fits into two registers, it's not > + good to pass a pointer to it; better performance to pass it by value. Note > + that this is for release builds, not debug builds where StringView has > + significant additional overhead when copying. Was there a measurable performance improvement by doing this? Comment on attachment 437204 [details]
Patch
Need a new version of this patch; the iterator part of it is wrong for debug builds.
Comment on attachment 437204 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=437204&action=review >> Source/WTF/ChangeLog:11 >> + significant additional overhead when copying. > > Was there a measurable performance improvement by doing this? I do not expect improvement to be measurable except in a micro-benchmark. As with any change, it’s important to double check we don’t measure a slowdown in any of our larger scale benchmarks, and I tried a couple locally and saw no difference. Created attachment 437312 [details]
Patch
Committed r282242 (241525@main): <https://commits.webkit.org/241525@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 437312 [details]. |