
High Performance JavaScript
Description
Alles über E-Books | Antworten auf Fragen rund um E-Books, Kopierschutz und Dateiformate finden Sie in unserem Info- & Hilfebereich.
More details
Other editions
Additional editions

Content
- Intro
- High Performance JavaScript
- Dedication
- Foreword
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 7. Ajax
- Data Transmission
- Requesting Data
- XMLHttpRequest
- POST versus GET when using XHR
- Dynamic script tag insertion
- 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
- 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
- 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
- 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
- About the Author
- Colophon
- Copyright
System requirements
File format: ePUB
Copy protection: Adobe-DRM (Digital Rights Management)
System requirements:
- Computer (Windows; MacOS X; Linux): Install the free reader Adobe Digital Editions prior to download (see eBook Help).
- Tablet/smartphone (Android; iOS): Install the free app Adobe Digital Editions or the app PocketBook before downloading (see eBook Help).
- E-reader: Bookeen, Kobo, Pocketbook, Sony, Tolino and many more (not Kindle).
The file format ePub works well for novels and non-fiction books – i.e., „flowing” text without complex layout. On an e-reader or smartphone, line and page breaks automatically adjust to fit the small displays.
This eBook uses Adobe-DRM, a „hard” copy protection. If the necessary requirements are not met, unfortunately you will not be able to open the eBook. You will therefore need to prepare your reading hardware before downloading.
Please note: We strongly recommend that you authorise using your personal Adobe ID after installation of any reading software.
For more information, see our ebook Help page.