[Webkit-unassigned] [Bug 247782] Very slow DOM rendering of large (plain text/json) URLs

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Nov 11 11:42:39 PST 2022


https://bugs.webkit.org/show_bug.cgi?id=247782

--- Comment #2 from zalan <zalan at apple.com> ---
(In reply to Vladimir Prelovac from comment #0)
> Loading this URL
> 
> https://raw.githubusercontent.com/json-iterator/test-data/master/large-file.
> json
> 
> Takes unnecessary long time. 
> 
> On my system it takes about 2 seconds to load the file, and 28 seconds to
> render it in DOM, which is unexpected given it is a text file.
> 
> Firefox does the same in about 12 seconds, which is still inefficient but
> still 2.5x faster.
> 
> Even stranger, loading the file with pure JavaScript:
> 
> fetch('https://raw.githubusercontent.com/json-iterator/test-data/master/
> large-file.json')
>   .then((response) => response.text())
>   .then((data) => document.write("<pre>"+data+"</pre>");
> 
> Takes only 2 seconds, or 15 times faster than native browser loading!
It's curious. For some reason (easy to figure out, just haven't debugged it yet) the direct .json file rendering goes down the legacy line layout codepath, while the "document.write()" case exercises the modern line layout codepath (at this point most of the inline content should go through the modern codepath, so it's rather interesting as to why we fallback to legacy for case #1).
Thank you for filing it.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20221111/b5f1a4be/attachment.htm>


More information about the webkit-unassigned mailing list