作者:empty 页数:456 出版社:empty |
All rights reserved.No part of this book maybe reproduced, stored in a retrievalsystem, or transmitted in any form or by any means, without the prior writtenpermission of the publisher, except in the case of brief quotations embedded incritical articles or reviews.Every effort has been made in the preparation of this book to ensure the accuracyof the information presented.However, the information contained in this book issold without warranty, either express or implied.Neither the author, nor Pack tPublishing, and its dealers and distributors will beheld liable for any damagescaused or alleged to because d directly or indirectly by this bookPack t Publishing has endeavored to provide trademark information about all of thecompanies and products mentioned in this book by the appropriate use of capitals.However, Pack t Publ shing can not guarantee the accuracy of this information
About the AuthorAbout the ReviewersMatt Per deck has over 20 years of experience in developing high-performancesoftware systems, ranging from the largest ATM network in The Netherlands toembedded software in advanced Wide Area Networks.After graduating as aB.Scin Computer Science from the University of Technology Twente, The Netherlandshe designed and developed software in Australia, The Netherlands, Slovakia, andThailand.Along the way, he also ea medan M.B.A.from the University of WesternAustralia and Copenhagen Business School.He has extensive.NET and SQLServerdevelopment experience and has written several NET articles.As an oldschoolsoftware engineer, he is passionate about making things faster, simpler, and moreefficient.Hiswebsiteaddressishttp://advancedwebaitetechnology.comMaarten Ball i a uw has a Bachelor's degree in Software Engineering, and has eightyears of experience in software development.He started his career during his studies,when he founded a company doing web development in PHP and ASP.NET.Aftergraduation, he sold hs shares and joined one of the largest ICT companies in Belgium,Real Dolmen, where he continued web application development in ASP.NET andapplication lifecycle management in VisualStudio Team System.He is a MicrosoftCertified Technology Specialist ASP.NET and Most Valuable Professional(MVP) ASPNET, and works with the latest Microsoft technologies, such as LINQ and ASP.NET3.5.He has published many articles in both PHP and.NET literature, such as MSDNmagazine Belgium and PHP Architect.Maarten wrote the book ASP.NET VC 1.0Quickly with Pack t Publishing.Maarten is a frequent speaker at various national andinternational events.
A yoo sh Joshi, MCAD, MCSD NET, former C TO of Cert Guard Inc., has beenactively involved with Microsoft technologies since the advent of.NET.He alsoholds a Masters degree in Computer ApplicationsCurrently, he is an active partner in the InfoTech firm, Apex Web Solutions, inaddition to providing technological consultation and training to various firmsincluding Turk Reno Inc.In his leisure time, he frequents various technology newsgroups, such asStackoverflow.comunder the moniker, Cereb rus.He has also been single-handedlymoderating the“Dotnet Development Google Group'since the past five years.Since his learning days, he has been obsessed with evaluating and maximizingapplication performance, and has always kept an eye out for the holy grail of Optimal Performance'.Every book is a team effort, and this is no except on.I wish to thankDavid Barnes, who responded to my original book proposal a fewhours before I got on a plane to Ethiopia, and helped me have itaccepted at Pack t.Also, thanks to him, I could maintain a properstructure of the book while writing it.Next, I would like to thankMaitreya Bha kal, who painstakingly reviewed my first drafts,drafted in technical reviewers, and engaged in latenight discussionswith me about the optimal way to express what I was trying to sayin the Englishlanguage.I am also grateful for the efforts of Kru tikaKate lia, who checked every detail and made the book ready forpublishing.And last but not least, my thanks go out to Sri moye eGhoshal, who kept the whole project on track, and to Lata Basant an i,who looked after the contract.
Shiv prasad Koirala, MVP, ASP.NET, MCAD, MCSD.NET, Former CEO ofwww.questpond.com, has been actively involved in teaching the latest Microsofttechnologies for past 14 years.He is a currently working as the CEO for a leading training company and earns hisdaily bread by giving training, writing technical books, recording training videos,and providing consultancy to many leading IT firmsHe has authored around 20 books on technology, revolving around interviewquestions series, which includes the bestseller, .NET Interview QuestionsMichael Allen Smith is a software professional living in Seattle, WA.He has beendeveloping websites since 1995.
TableofContents
Chapter2:ReducingTimetoFirstByte
Pinpointing bottlenecks
Memory
Windows Server 2003
Usability testing
Using StringBuilder
When not to use StringBuilder
StringBuilder capacity
Windows Vista, Windows Server 2008.or Windows 7
Simula in ga memory shortage
Caching
CPU
Thread usage
Long wait times
Additional measures
Deployment
Building projects in release mode
Publishing your website
Disabling debug mode
Reducing number of assemblies
Reducing roundtrips
Using Server.Transfer instead of Response.Redirect
A wy.speighedfuienURLs
Pe men ented ae
Minimizing CNAME records
SSL
Unwanted requests
Searchengine bots
Ho linking
CAPTCHA
Scrapers
Find out more
Summary
Chapter3:Memory
Managed resources
Lifecycle
Generations
Large Object Heap
Counters
CLR profiler
Garbage collector versions
Acquire late
Release early
Using StringBuilder to concatenate strings
Using Compare for case-insensitive compares
Using Response.Write buffer
Pooling objects over 85KB
Unmanaged resources
IDisposable
Counters
Sessions
Reducing session state lifetime
Reducing space taken by session state
Using another session mode
Stop using session state
Find out more
Summary
Chapter4:CPU
Identifying bottlenecks
Tools
Data access
Connection pooling
DataSet versus List
Re tum ning multiple resultsets
Sending multiple inserts in one go
Using native data providers
Exceptions
Revealing the time taken by exceptions
Counters
Data Binder.Eval
Garbage collector
Threading
StringBuilder
Regex instantiation
Utc Now
For each
Virtual properties
Avoid unnecessary processing
Trimming HTTP pipeline
Find out more
Summary
Chapter5:Caching
Browser caching
Output Cache directive
Enabling caching in code
Disabling caching in code
Proxy caching
Caching different versions of the same page
Cookies
Removing querystring from URL
URL Rewrite extension to I IS 7
Rewrite Path method in Global.a sax
Reset ig the form action a tribute
Output caching
What to cache and what not to cache
Enabling output caching
Output cache example
Vary By Param
Vary By Header
Vary By Custom
Vary By Custom by browser
Fragment caching
Post-cache substitution
Output cache provider
Creating an output cache provider
Using an output cachep ravi der
Kernel caching and I IS 7 output caching
Configuring I IS caching
Limitations of kem el caching
Checking the contents of the kernel cache
Data caching
Basic use
Expiry
Priority
File dependencies
Database dependen cles
Restrictions on queries
VO-related coni guration
ASP.NET 2.0
Creat ng counters with VisualStudio
Creating counters programmatically
Starting the Service Broker
Starting the listening service
Crea ing the dependency
Item removed callback
Things to keep in mind
Optimal use of server cache
Find out more
Summary
Chapter6:ThreadUsage
Asynchronous webservice access
Synchronous version
Asynchronous version
Asynchronous data access layer
Usage
Implementation
Performance testing
Asynchronous generic handlers
Synchronous version
Asynchronous version
Implementation
Performance testing
Asynchronous file writes
Synchronous version
Asynchronous version
A word of caution
Asynchronous web requests
Configuration changes
I IS 6, I IS 7 Classic Mode
I IS 7 integrated mode
Maximum queue size
Setting timeouts aggressively
Find out more
Summary
Chapter7:ReducingLongWaitTimes
Measuring wait times
Creating custom counters
Updating counters in your code
Viewing custom counters in perfmon
Waiting concurrently
Retrieving multiple resultsets from the database
Reducing overhead by using off-box session modes
Reducing trips to the database
Seting Enable Session State
Reducing serialization and transfer overhead
Cutting your dependence on sessions
Minimizing the duration of locks
Using granular locks
Using System.Threading.Interlocked
Using Reader Writer Lock
Acqui iga reader lock
Acquiring a writer lock
Alterna ing readers and writers
Optimizing disk writes
Avoiding head seeks
Missing indexes
Expensive queries
Unused indexes
Performance counters
dm_exec_query_optimizer_info
sys.dm_exec cached plans
Clustered index
Non-clustered index
Included columns
Using FileStream.SetLength to avoid fragmentation
Using 64K buffers
Disabling 8.3 filenames
Find out more
Summary
Chapter8:SpeedingupDatabaseAccess
Pinpointing bottlenecks
Missing indexes and expensive queries
Locking
Execution plan reuse
Fragmentation
Memory
Disk usage
CPU
Fixing bottlenecks
Missing indexes
Selec ing columns to give an index
Maintaining indexes
Expensive queries
Cache aggregation queries
Keeping records short
Considering denormalization
Being careful with triggers
Using table variables for small temporary resultsets
Using fulltext search instead of LIKE
Replac ng cursors w thse-based code
Minimizing traf fc from SQLserver to webserver
Object naming
Jig serNa couNT ON
Using FILESTREAM for values over 1MB
Avoiding functions on columns in WHERE clauses
Using UNION ALL ins lead of UNION
What is View State?
Why