Book description
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.
Table of contents
-
F# High Performance
- F# High Performance
- Credits
- About the Author
- About the Reviewer
- www.PacktPub.com
- Customer Feedback
- Preface
- 1. Performing Common Optimizations in F#
- 2. Performance Measurement
-
3. Optimizing Data Structures
- Overview and best practices of types in F#
- Quick introduction to types in F#
- Quick overview of generic type support in F#
- Introduction to memory storage allocation
- 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
-
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
- Summary
- 5. Advanced Concurrency Support in F#
- 6. Optimizing Type Provider
-
7. Language Features and Constructs Optimization
- Overview of language features and constructs optimization
- Optimizing common F# language constructs
- Optimizing inline functions
- Identifying tail call in recursive constructs
- Summary
- 8. Optimizing Computation Expressions
Product information
- Title: F# High Performance
- Author(s):
- Release date: January 2017
- Publisher(s): Packt Publishing
- ISBN: 9781786468079
You might also like
book
F# for Scientists
This work strikes a balance between the pure functional aspects of F# and the object-oriented and …
book
F# Deep Dives
F# Deep Dives presents a collection of real-world F# techniques, each written by expert practitioners. Each …
book
Beginning F# 4.0
This book is a great foundation for exploring functional-first programming and its role in the future …
book
F# for Quantitative Finance
An introductory guide to utilizing F# for quantitative finance leveraging the .NET platform Learn functional programming …