F# High Performance
eBook - ePub

F# High Performance

Eriawan Kusumawardhono

Share book
  1. 338 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

F# High Performance

Eriawan Kusumawardhono

Book details
Book preview
Table of contents
Citations

About This Book

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.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on “Cancel Subscription” - it’s as simple as that. After you cancel, your membership will stay active for the remainder of the time you’ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlego’s features. The only differences are the price and subscription period: With the annual plan you’ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is F# High Performance an online PDF/ePUB?
Yes, you can access F# High Performance by Eriawan Kusumawardhono in PDF and/or ePUB format, as well as other popular books in Computer Science & Programming Languages. We have over one million books available in our catalogue for you to explore.

Information

Year
2017
ISBN
9781786468079

F# High Performance


F# High Performance

Copyright Š 2017 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: January 2017
Production reference: 1130117
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78646-807-9
www.packtpub.com

Credits

Author
Eriawan Kusumawardhono
Copy Editor
Safis Editing
Reviewer
Arthur Pham
Project Coordinator
Ulhas Kambli
Commissioning Editor
Kunal Parikh
Proofreader
Safis Editing
Acquisition Editor
Sonali Vernekar
Indexer
Tejal Daruwale Soni
Content Development Editor
Nikhil Borkar
Graphics
Abhinash Sahu
Technical Editor
Hussain Kanchwala
Production Coordinator
Shraddha Falebhai

About the Author

Eriawan Kusumawardhono is a veteran senior software development engineer (SDE) who has software development experience of more than 13 years, with 11 years of having developed in .NET, since the introduction of Visual Studio 2003. On usual working day he works at Allegro Development, a software development company, and in his spare time, he does speaking and training for software development and programming language communities in Indonesia. He is also a member of F# Foundation speaker program. He enjoys being a full-time technical polyglot software developer, mingling both OOP and functional programming at the same time.
He currently holds a Microsoft MVP award in Visual Studio development platform competency, from 2011 to 2017, for more than 5 consecutive years.
He lives in Jakarta with his wife, enjoying reading and cooking heterogeneous exotic food in Indonesia.
Many thanks to Microsoft, especially Microsoft Research, and Don Syme for developing F#, a functional programming that meets OOP nicely and truly pragmatic! I would like to give special thanks to Packt for giving me the chance to write this wonderful book and Nikhil for his continuous support and always giving me constructive feedback. I also would like to give a big huge thanks for my lovely wife, Dini Kusumawardhono, for always giving me unconditional love and support during the writing of this book and also her continuous understanding every day. I would like to dedicate this book to software development communities in Indonesia, and to all of the F# developer communities around the world. F# rocks!

About the Reviewer

Arthur Pham has been working for Thomson Reuters as a Lead Quantitative Engineer since 2006.
He has spent many years designing and implementing derivatives pricing models and still loves learning new programming languages, such as F#, C++, Python, Flex/ActionScript, C#, Ruby, and JavaScript.
He currently lives in New York, NY, USA and can be contacted on Twitter at @arthurpham.

www.PacktPub.com

For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
www.PacktPub.com
https://www.packtpub.com/mapt
Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt books and video courses, as well as industry-leading tools to help you plan your personal development and advance your career.

Why subscribe?

  • Fully searchable across every book published by Packt
  • Copy and paste, print, and bookmark content
  • On demand and accessible via a web browser

Customer Feedback

Thank you for purchasing this Packt book. We take our commitment to improving our content and products to meet your needs seriously—that's why your feedback is so valuable. Whatever your feelings about your purchase, please consider leaving a review on this book's Amazon page. Not only will this help us, more importantly it will also help others in the community to make an informed decision about the resources that they invest in to learn. You can also review for us on a regular basis by joining our reviewers' club. If you're interested in joining, or would like to learn more about the benefits we offer, please contact us: [email protected].

Preface

It’s well-known today that F# has been quite a first class citizen, a built-in part of programming language support in Visual Studio from Visual Studio 2010. F# is a programming language that has its own unique trait: it is a functional programming language, and at the same time, it has OOP support. F# has run on .NET until now, although we can also run F# as a cross-platform language, such as on Android (using Mono).
Although F# mostly runs faster than C# or VB when doing computations, F# has its own unique performance characteristics. Some of the performance characteristics might not be so obviously identified and code implementations might have implicit bad practices and subtleties that may lead to performance bottlenecks. The bottlenecks may or may not be faster than C#/VB counterparts, although some of the bottlenecks may share the same performance characteristics, such as the use of .NET APIs.
The main goal of this book is to identify the performance problems in F#, measuring and optimizing F# code to run more efficiently, while also maintaining the functional programming style as appropriately as possible.
This book focuses on optimizing F#. A basic skill of F# knowledge (including functional programming concept and basic OOP) is a prerequisite to start understanding its performance problems and optimizing F#.

What this book covers

Chapter 1, Performing Common Optimizations in F#, introduces F# and gives an overview of the common problems in F# code.
Chapter 2, Performance Measurement, helps you get to know what and how to measure and the tooling ecosystem to measure performance.
Chapter 3, Optimizing Data Structures, helps you decide the best and the most optimal use of F#-specific data structures and optimize them.
Chapter 4, Introduction to Concurrency in F#, provides a general introduction to the concept of concurrency and concurrency implementation support in F#.
Chapter 5, Advanced Concurrency Support in F#, provides best practices in implementing advanced concurrency support in F#, including interop with .NET TPL and avoiding performance pitfalls.
Chapter 6, Optimizing Type Provider, gives a quick walk-through of type provider implementation, while at the same time providing optimization and avoiding performance pitfalls in implementing your own custom type providers.
Chapter 7, Language Features and Constructs Optimization, explains best practices when implementing and using various F# language features and constructs without sacrificing the performance and correctness in functional programming.
Chapter 8, Optimizing Computation Expressions, explains ...

Table of contents