Javascript file downloads fast but renders slow

This was done by rendering a static HTML content file, and at times The initial page load will be slow and since the network speed isn't. Minification will reduce the size of a CSS or JavaScript file and for a script to finish downloading before the page renders (which can. IF I send an AJAX request to a PHP file, what would result in faster rendering of HTML: Sending the completely formatted HTML straight from PHP.
· Here are a few things that can cause JavaScript performance to falter: 1. Too many interactions with the host. Every interaction with the host object, or the user's browser, increases unpredictability and contributes to performance lag. This problem often manifests as slow rendering . · Most JavaScript files load in less than milliseconds. Any more than ms load time is a major red flag. In the waterfall snippet below we see the Tealium (bltadwin.ru) takes ms (very slow). Rather than loading your javascript on-demand (which can cause a noticeable gap), load your script in the background, after a delay. Use something like. var delay = 5; setTimeout ("loadExtraFiles ();", delay * ); This will call loadExtraFiles () after 5 seconds, which should load the files you need (using $import).
For every JavaScript reference, the browser stops downloading and processing of any other content on the page and some browsers (like Internet Explorer 6) pause rendering while it processes the JavaScript. This gives a slow loading experience and the Web page kind of gets 'stuck' frequently. Depending on the application it might be viable to split your javascript into 2 bundles. A critical path script that is small and downloads quickly and contains the bare minimum to allow the page to start rendering. Then a larger, lazy loaded script containing everything else that will download at some point later in the page load. Internet Explorer's Javascript engine is slower than that from other web browsers, at least when using IE with versions lower than 9. So, if you're using IE 6, 7 or 8, now you know why. Like raynjamin said, try testing IE using Sunspider. The latest stable Firefox () is fast, but for example, Google Chrome is even faster.
0コメント