257 high performance javascript

232 137 0
257 high performance javascript

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

... High- Performance JavaScript Applications 163 Apache Ant Combining JavaScript Files Preprocessing JavaScript Files JavaScript Minification Buildtime Versus Runtime Build Processes JavaScript. ..www.it-ebooks.info www.it-ebooks.info High Performance JavaScript www.it-ebooks.info www.it-ebooks.info High Performance JavaScript Nicholas C Zakas Beijing • Cambridge • Farnham... information on JavaScript affecting page download performance are the Yahoo! Exceptional Performance team (http://developer.yahoo.com /performance/ ) and Steve Souders, author of High Performance

Ngày đăng: 11/07/2018, 09:23

Từ khóa liên quan

Mục lục

  • Table of Contents

  • Preface

    • The Internet Evolves

    • Why Optimization Is Necessary

    • Next-Generation JavaScript Engines

    • Performance Is Still a Concern

    • How This Book Is Organized

    • JavaScript Loading

    • Coding Technique

    • Deployment

    • Testing

    • Who This Book Is For

    • Conventions Used in This Book

    • Using Code Examples

    • Safari® Books Online

    • How to Contact Us

    • Acknowledgments

  • Chapter 1. Loading and Execution

    • Script Positioning

    • Grouping Scripts

    • Nonblocking Scripts

      • Deferred Scripts

      • Dynamic Script Elements

      • XMLHttpRequest Script Injection

      • Recommended Nonblocking Pattern

        • The YUI 3 approach

        • The LazyLoad library

        • The LABjs library

    • Summary

  • Chapter 2. Data Access

    • Managing Scope

      • Scope Chains and Identifier Resolution

      • Identifier Resolution Performance

      • Scope Chain Augmentation

      • Dynamic Scopes

      • Closures, Scope, and Memory

    • Object Members

      • Prototypes

      • Prototype Chains

      • Nested Members

      • Caching Object Member Values

    • Summary

  • Chapter 3. DOM Scripting

    • DOM in the Browser World

      • Inherently Slow

    • DOM Access and Modification

      • innerHTML Versus DOM methods

      • Cloning Nodes

      • HTML Collections

        • Expensive collections

        • Local variables when accessing collection elements

      • Walking the DOM

        • Crawling the DOM

        • Element nodes

        • The Selectors API

    • Repaints and Reflows

      • When Does a Reflow Happen?

      • Queuing and Flushing Render Tree Changes

      • Minimizing Repaints and Reflows

        • Style changes

        • Batching DOM changes

      • Caching Layout Information

      • Take Elements Out of the Flow for Animations

      • IE and :hover

    • Event Delegation

    • Summary

  • Chapter 4. Algorithms and Flow Control

    • Loops

      • Types of Loops

      • Loop Performance

        • Decreasing the work per iteration

        • Decreasing the number of iterations

      • Function-Based Iteration

    • Conditionals

      • if-else Versus switch

      • Optimizing if-else

      • Lookup Tables

    • Recursion

      • Call Stack Limits

      • Recursion Patterns

      • Iteration

      • Memoization

    • Summary

  • Chapter 5. Strings and Regular Expressions

    • String Concatenation

      • Plus (+) and Plus-Equals (+=) Operators

        • Firefox and compile-time folding

      • Array Joining

      • String.prototype.concat

    • Regular Expression Optimization

      • How Regular Expressions Work

      • Understanding Backtracking

        • Alternation and backtracking

        • Repetition and backtracking

      • Runaway Backtracking

        • The solution: Be specific

        • Emulating atomic groups using lookahead and backreferences

        • Nested quantifiers and runaway backtracking

          • From bad to worse

      • A Note on Benchmarking

      • More Ways to Improve Regular Expression Efficiency

      • When Not to Use Regular Expressions

    • String Trimming

      • Trimming with Regular Expressions

      • Trimming Without Regular Expressions

      • A Hybrid Solution

    • Summary

  • Chapter 6. Responsive Interfaces

    • The Browser UI Thread

      • Browser Limits

      • How Long Is Too Long?

    • Yielding with Timers

      • Timer Basics

      • Timer Precision

      • Array Processing with Timers

      • Splitting Up Tasks

      • Timed Code

      • Timers and Performance

    • Web Workers

      • Worker Environment

      • Worker Communication

      • Loading External Files

      • Practical Uses

    • Summary

  • Chapter 7. Ajax

    • Data Transmission

      • Requesting Data

        • XMLHttpRequest

        • Dynamic script tag insertion

          • POST versus GET when using XHR

        • Multipart XHR

      • Sending Data

        • XMLHttpRequest

        • Beacons

    • Data Formats

      • XML

        • XPath

        • Response sizes and parse times

      • JSON

        • JSON-P

        • Should you use JSON?

      • HTML

      • Custom Formatting

      • Data Format Conclusions

    • Ajax Performance Guidelines

      • Cache Data

        • Setting HTTP headers

        • Storing data locally

      • Know the Limitations of Your Ajax Library

    • Summary

  • Chapter 8. Programming Practices

    • Avoid Double Evaluation

    • Use Object/Array Literals

    • Don’t Repeat Work

      • Lazy Loading

      • Conditional Advance Loading

    • Use the Fast Parts

      • Bitwise Operators

      • Native Methods

    • Summary

  • Chapter 9. Building and Deploying High-Performance JavaScript Applications

    • Apache Ant

    • Combining JavaScript Files

    • Preprocessing JavaScript Files

    • JavaScript Minification

    • Buildtime Versus Runtime Build Processes

    • JavaScript Compression

    • Caching JavaScript Files

    • Working Around Caching Issues

    • Using a Content Delivery Network

    • Deploying JavaScript Resources

    • Agile JavaScript Build Process

    • Summary

  • Chapter 10. Tools

    • JavaScript Profiling

    • YUI Profiler

    • Anonymous Functions

    • Firebug

      • Console Panel Profiler

      • Console API

      • Net Panel

    • Internet Explorer Developer Tools

    • Safari Web Inspector

      • Profiles Panel

      • Resources Panel

    • Chrome Developer Tools

    • Script Blocking

    • Page Speed

    • Fiddler

    • YSlow

    • dynaTrace Ajax Edition

    • Summary

  • Index

Tài liệu cùng người dùng

Tài liệu liên quan