售 价:¥
温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印
为你推荐
F# High Performance
F# High Performance
Credits
About the Author
About the Reviewer
www.PacktPub.com
Why subscribe?
Customer Feedback
Preface
What this book covers
Who this book is for
What you need for this book
Basic requirements and setup environments
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Performing Common Optimizations in F#
Understanding the nature of F# code
F# runtime characteristics
Relation between F# code and its generated assembly
Immutability versus mutability
Overview of common bottlenecks
Common samples of misunderstood concurrent problems
Introduction to concurrency in F#
Defining asynchronous
Misunderstood concurrency problems
Introduction to concurrency support in .NET and F#
Overview of F# tooling in Visual Studio
Interactive support for F# interactive
Introduction to debugging in F#
Summary
2. Performance Measurement
Introduction to the nature of F# code compilation
General overview of F# compiler processes and results
A quick overview of IL in F#
IL tooling in .NET
Using ILDASM and ILASM to understand low-level IL assembly
Using CLR Profiler 4.5
A quick overview of CLR Profiler
A quick walkthrough of CLR Profiler in action
Ways to measure performance quantitatively
Using .NET timers
Running functions inside unit tests
A quick introduction to unit tests
Unit test support in Visual Studio
Using FsUnit to implement a unit test in F#
Summary
3. Optimizing Data Structures
Overview and best practices of types in F#
Static typing versus dynamic typing
Quick introduction to types in F#
Quick overview of generic type support in F#
Overall runtime strategy of handling data types
Introduction to memory storage allocation
Register
Stack
Heap
Best practices of types for storing and accessing data
Best practices in using F# collections
Comparing F# List to .NET List<T>
Comparing F# Map to Dictionary<TKey,TValue>
Choosing a value evaluation strategy
Scenarios involving evaluation strategy and memory allocations
Summary
4. Introduction to Concurrency in F#
Introducing concurrency support in F# 4
Identifying blocking threads
Overview of the background technical reasons for the blocking nature of I/O
Obvious trait of a blocking thread
Introducing asynchronous workflow
Getting to know asynchronous workflow
Using asynchronous with Dispose pattern
Operations in asynchronous workflow
Creating child asynchronous workflow
F# asynchronous workflow support for legacy .NET APM and EAP
Ignoring asynchronous operation asynchronously
Delaying asynchronous workflow
Handling cancellation in asynchronous workflow
Common conventions when implementing asynchronous operations
Introduction to interop with .NET TPL
A quick overview of asynchronous programming in .NET TPL
Summary
5. Advanced Concurrency Support in F#
Using F# MailboxProcessor
Background case of having message agent
Introducing fire and forget pattern
Overview of a message agent
Overview of serialization
Introduction to F# MailboxProcessor
Overview of MailboxProcesor features
Further implementations of MailboxProcessor
Managing side effects inside MailboxProcessor and asynchronous workflows
Parallel programming with .NET TPL
Overview of task-based parallelism
Quick start-using the parallel debugging tool in Visual Studio
Overview of data parallelism
Common potential pitfalls in parallel programming
Overview of handling mutable state
Summary
6. Optimizing Type Provider
Overview of F# type provider
Comparing the type provider with other type generators
Interoperability with other managed programming languages
Understanding the type provider building blocks
Minimum requirements of type providers
Strategies of type provider implementation
Choosing strategies of type provider implementation
Sample usage of built-in type provider in F#
Quick sample of using SqlDataConnection type provider
Implementing your own type provider
Building the type's building blocks
Building type metadata infrastructure
Implementing assembly to provide base assembly
Implementing parameters for methods and constructors
Implementing generated constructor
Implementing generated methods
Implementing generated properties
Basic minimal implementation of type provider
Common pitfalls in implementing type provider
Summary
7. Language Features and Constructs Optimization
Overview of language features and constructs optimization
Optimizing common F# language constructs
Best practices of interoperability of F# delegate with .NET delegate
Passing a .NET delegate as an F# function
Calling .NET delegate within F#
Best practices in pattern matching and active pattern
Comparing constant pattern matching with if constructs
Best practices in using active patterns
Considerations in catching exceptions in active patterns
Optimizing inline functions
Background overview of inline functions and related type inferences
Overview of F# type inference mechanism of generic type inference
Overview of automatic generalization in F#
Best practices in implementing inline functions
Identifying tail call in recursive constructs
Overview of recursion in functional programming
Tail call recursion in F# and .NET CLR
Identifying tail call optimized implementation
Advantages of having tail call recursive implementation
Limitations of tail call recursion in F#
Summary
8. Optimizing Computation Expressions
Quick introduction to F# computation expression
Introduction to builders of computation expression
Using F# function/delegate over .NET Func
Relation of F# function computation expressions with arguments restriction
Walkthrough of planning and writing a computation expression
Understanding the use of type returned in computation expression
General computation expression design considerations
Implications of the design considerations of computation expression
Considerations of computation expression optimization
Summary
买过这本书的人还买过
读了这本书的人还在读
同类图书排行榜