万本电子书0元读

万本电子书0元读

顶部广告

F# High Performance电子书

售       价:¥

2人正在读 | 0人评论 9.8

作       者:Eriawan Kusumawardhono

出  版  社:Packt Publishing

出版时间:2017-01-01

字       数:255.8万

所属分类: 进口书 > 外文原版书 > 电脑/网络

温馨提示:数字商品不支持退换货,不提供源文件,不支持导出打印

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Build powerful and fast applications with F# About This Book· Explore the advanced concurrency support in F# and .NET TPL·Covers major optimization techniques in F# to improve the performance of applications·Use Struct, Class and Record model, Interop with C# and VB without sacrificing performance. Who This Book Is For This book is for F# developers who want to build high-performance applications. Knowledge of functional programming would be helpful. What You Will Learn· Understand how the execution of functions in F# works·Identify common performance bottlenecks·Implement best practices to optimize performance·Use the available tooling to help measure performance·Combine the best practice of asynchronous and synchronous·Optimize further using various F# language constructs In Detail F# is a functional programming language and is used in enterprise applications that demand high performance. It has its own unique trait: it is a functional programming language and has OOP support at the same time. This book will help you make F# applications run faster with examples you can easily break down and take into your own work. You will be able to assess the performance of the program and identify bottlenecks. Beginning with a gentle overview of concurrency features in F#, you will get to know the advanced topics of concurrency optimizations in F#, such as F# message passing agent of MailboxProcessor and further interoperation with .NET TPL. Based on this knowledge, you will be able to enhance the performance optimizations when implementing and using other F# language features. The book also covers optimization techniques by using F# best practices and F# libraries. You will learn how the concepts of concurrency and parallel programming will help in improving the performance. With this, you would be able to take advantage of multi-core processors and track memory leaks, root causes, and CPU issues. Finally, you will be able to test their applications to achieve scalability. Style and approach This easy-to-follow guide is full of hands-on examples of real-world multithreading tasks. Each topic is explained and placed in context, and for the more inquisitive, there are also more in-depth details of the concepts used.
目录展开

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

累计评论(0条) 0个书友正在讨论这本书 发表评论

发表评论

发表评论,分享你的想法吧!

买过这本书的人还买过

读了这本书的人还在读

回顶部