Let's take a closer look at how a browser retrieves and acts on scripts.
modern browser can parallel downloading 6 files(style sheets && images)
at a time. BUT, when it see Scripts, the parallel downloading will stop!
Therefore, any scripts in <head></head> which are not that necessary to be there
might affect you browser performance

1. Scripts that are not essential to immediate loading of the page should be
moved as low as possible, in front of </body>

2. With external files, the HTML5 async attribute will allow the rest of the
page to load before the script runs.
When browser loading page, once see async attribute,
it will now fetch the script resource, but will continue parsing and rendering
HTML, without waiting for the script to complete!

<script src="formOjbect.js" async></script>

-----------------------------Ex------------------------------

"Be careful, for data intensive processes are the ones that will stop the show. Which of these included script tags will take the longest to load"

inhabitants.js

var invertedPeninsula = {
inhabitants: [
"Nipping Global Variable",
"Sneaky For-in",
"Bulging Blocking Script"
]
} function populationGetter(){
var population = invertedPeninsula.inhabitants;
var list = ""; for(var i = 0, ff = population.length; i < ff; i++){
list += (population[i] + " ");
}
return list.trim();
} populationGetter();

info.js

var land = "Inverted Peninsula";
var character = "Dhuun";
var lampsLit = 1;

inhabitantsProto.js

Array.prototype.killTheInsolent = function(){};
Array.prototype.countPopulace = function(){};
Array.prototype.countUndeadPopulace = function(){};
Array.prototype.incesticide = function(){};
Array.prototype.shadowProvider = function(){};

[Javascript]2. Improve you speed! Script Execution的更多相关文章

  1. [Javascript]3. Improve you speed! Performance Tips

    /** Let inheritance help with memory efficiency */ function SignalFire(ID, startingLogs){ this.fireI ...

  2. [Javascript]1. Improve you speed! Loop optimaztion

    /** Improve you loop code */ var treasureChest = { goldCoins: 10000, magicalItem : "Crown of Sp ...

  3. 【JavaScript性能优化】------理解Script标签的加载和执行

    1.script标签是如何加载的?当浏览器遇到一个 < script>标签时,浏览器会停下来,运行JavaScript代码,然后再继续解析.翻译页面.同样的事情发生在使用 src 属性加载 ...

  4. javaScript中的小细节-script标签中的预解析

    首先介绍预解析,虽然预解析字面意思很好理解,但是却是出坑出的最多的地方,也是bug经常会有的地方,利用好预解析的特性可以解决很多问题,并且提高代码的质量及数量,浏览器在解析代码前会把变量的声明和函数( ...

  5. 完整的JavaScript包括三部分、script标签、JavaScript的基本语法以及变量和字面量的关系

    完整的JavaScript包括三大部分: -ECMAScript   JavaScript的开发规范:提供核心语言功能 -DOM   document object model   文档对象模型:提供 ...

  6. Increase PHP script execution time with Nginx

    If you have a large WordPress setup or a server with limited resources, then you will often see the ...

  7. unity 脚本执行顺序设置 Script Execution Order Settings

     通过Edit->Project Settings->Script Execution Order打开MonoManager面板  或者选择任意脚本在Inspector视图中点击Execu ...

  8. Unity3D Script Execution Order ——Question

    我 知道 Monobehaviour 上的 那些 event functions 是 在主线程 中 按 顺序调用的.这点从Manual/ExecutionOrder.html 上的 一张图就可以看出来 ...

  9. JavaScript之<script>标签简介

    向html页面中插入JavaScrpt的主要方法,就是使用<script>元素,下面是Html 4.01为<script>定义的6个属性. 1.async:可选表示应该立即下载 ...

随机推荐

  1. Mybatis框架Day01(上)

    框架课程 1 课程计划 第一天: 1.mybatis的介绍 2.Mybatis的入门 a) 使用jdbc操作数据库存在的问题 b) Mybatis的架构 c) Mybatis的入门程序 3.Dao的开 ...

  2. Codeforces Round #228 (Div. 1) A. Fox and Box Accumulation 贪心

    A. Fox and Box Accumulation 题目连接: http://codeforces.com/contest/388/problem/A Description Fox Ciel h ...

  3. UVALive 6257 Chemist's vows

    #include<iostream> #include<string.h> #include<stdio.h> #include<ctype.h> #i ...

  4. UVALive 5059 C - Playing With Stones 博弈论Sg函数

    C - Playing With Stones Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu S ...

  5. Slickflow.NET 开源工作流引擎基础介绍(二) -- 引擎组件和业务系统的集成

    集成流程引擎的必要性 业务过程的变化是在BPM系统中常见的现象,企业管理层需要不断优化组织架构,改造业务流程,不可避免地带来了业务流程的变化,企业信息系统就会随之面临重构的可能性.一种直接的方式是改造 ...

  6. HDU 4706 Children's Day (水题)

    Children's Day Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)To ...

  7. SPOJ 10628. Count on a tree (树上第k大,LCA+主席树)

    10628. Count on a tree Problem code: COT You are given a tree with N nodes.The tree nodes are number ...

  8. SQLServer存储过程返回值总结

    1.  存储过程没有返回值的情况(即存储过程语句中没有return之类的语句)  用方法 int count = ExecuteNonQuery(..)执行存储过程其返回值只有两种情况  (1)假如通 ...

  9. C# iTextSharp 生成 PDF

    使用iTextSharp在Asp.Net中操作PDF系列文章 目录 http://www.cnblogs.com/CareySon/category/332146.html 实战 iTextSharp ...

  10. C#托管堆对象实例包含什么

    每个托管堆上的对象实例除了包含本身的值外,还包括:○ Type Object Ponter: 指向Type对象实例.如果是同类型的对象实例,就指向同一个Type对象实例.○ Sync Block In ...