开发者

Why does dojo parsing time depend on css and images availability?

I have been profiling javascript on my page that uses dojo widgets. I don't use explicit parsing - the parser runs on page load.

What I noticed is that if I clear browser cache before refreshing the page, dojo parsing takes much more time than if all the files are already cached.

Note that we build all the required dojo modules into a layer (a single file), so we don't lazy-load any js files.

I wonder if dojo parsing process depends on images and css resources, as far as I know it only instantiates widgets and injects dom nodes.

Do you have any ideas why dojo parser runs longer (2-3 times longer in my case)开发者_开发问答 when the cache is cleared?


Did you check if any files are loaded? Locales? NLS? Date/time parsing/formatting is highly culture-dependent, which can be resolved dynamically by locales, unless you did a proper build listing supported locales.


It sounds like the page load itself, not the parsing, would be slower if the cache is cleared, and that's no different from any other page. You can minimize CSS a bit with the build tool. The cssOptimize setting can inline all the @import files for Dijit the way it concatenates CSS, if you're not already doing that. Images can be tiled also to help with performance.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜