万本电子书0元读

万本电子书0元读

顶部广告

Mastering High Performance with Kotlin电子书

售       价:¥

2人正在读 | 0人评论 9.8

作       者:Igor Kucherenko

出  版  社:Packt Publishing

出版时间:2018-06-15

字       数:28.2万

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

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

为你推荐

  • 读书简介
  • 目录
  • 累计评论(0条)
  • 读书简介
  • 目录
  • 累计评论(0条)
Find out how to write Kotlin code without overhead and how to use different profiling tools and bytecode viewer to inspect expressions of Kotlin language. About This Book ? Apply modern Kotlin features to speed up processing and implement highly efficient and reliable codes. ? Learn memory optimization, concurrency, multi-threading, scaling, and caching techniques to achieve high performance. ? Learn how to prevent unnecessary overhead and use profiling tools to detect performance issues. Who This Book Is For This book is for Kotlin developers who would like to build reliable and high-performance applications. Prior Kotlin programming knowledge is assumed. What You Will Learn ? Understand the importance of high performance ? Learn performance metrics ? Learn popular design patterns currently being used in Kotlin ? Understand how to apply modern Kotlin features to data processing ? Learn how to use profling tools ? Discover how to read bytecode ? Learn to perform memory optimizations ? Uncover approaches to the multithreading environment In Detail The ease with which we write applications has been increasing, but with it comes the need to address their performance. A balancing act between easily implementing complex applications and keeping their performance optimal is a present-day requirement In this book, we explore how to achieve this crucial balance, while developing and deploying applications with Kotlin. The book starts by analyzing various Kotlin specifcations to identify those that have a potentially adverse effect on performance. Then, we move on to monitor techniques that enable us to identify performance bottlenecks and optimize performance metrics. Next, we look at techniques that help to us achieve high performance: memory optimization, concurrency, multi threading, scaling, and caching. We also look at fault tolerance solutions and the importance of logging. We'll also cover best practices of Kotlin programming that will help you to improve the quality of your code base. By the end of the book, you will have gained some insight into various techniques and solutions that will help to create high-performance applications in the Kotlin environment Style and approach This book guides you through how to use profiling tools to detect performance issues and build high-performance applications in the Kotlin environment.
目录展开

Title Page

Copyright and Credits

Mastering High Performance with Kotlin

Packt Upsell

Why subscribe?

PacktPub.com

Contributors

About the author

About the reviewer

Packt is searching for authors like you

Preface

Who this book is for

What this book covers

To get the most out of this book

Download the example code files

Download the color images

Conventions used

Get in touch

Reviews

Identifying Performance Bottlenecks

Reasons for performance issues

Memory management

Garbage collection

Working principles of the garbage collector

Impacts of garbage collection

Heap fragmentation

Finalization

Resource leaks

Memory leaks

String pool

Memory model

The problem of concurrency and parallelism

Java Memory Model (JMM)

Synchronization

Slow rendering

Device refresh rate

Frame rate

Summary

Identifying Indicators of Performance Issues

Benchmarking

Microbenchmarks

Java Microbenchmark Harness (JMH)

Benchmark modes

Benchmark time units

Benchmark state

State scope

Fixture methods

Levels of fixture methods

Writing good benchmarks

The pitfalls of loops

Dead Code Elimination

Using black holes

Constant folding

Kotlin benchmarks

IDEA JMH plugin

General performance metrics

Types of performance testing

Performance testing process

Overview of performance testing tools

JMeter

Fabric

Summary

Learning How to Use Profiling Tools

Memory profiling

Memory Viewer

HProf

Eclipse Memory Analyzer Tool

Histogram

Shallow and Retained Heap

Dominator Tree

Top Consumers

Analyzing class loaders

Android Studio Memory Profiler

Memory categories

Recording memory allocation

Threads profiling

Threads viewer

Frames pane

The Threads pane

Thread profiling in the MAT

Threads Overview

Thread Details

CPU Profiler in Android Studio

Call Chart and Flame Chart tabs

Top Down and Bottom Up tabs

Summary

Functional Approach

Functional programming

Declarative versus imperative

Pure functions

First-class functions

Higher-order functions

Function composition

Lambdas

Closures

Typeclasses

Arrow library

Functor

Monad

Immutability

Inspecting functional features

Inline versus non-inline

Capturing and non-capturing lambdas

Summary

Enhancing the Performance of Collections

Data structures

Arrays

Linked lists

Stacks

Queues

Sets

Maps

Hash tables

Binary search trees

Tries

Binary heaps

Graphs

Time complexity

Calculating time complexity

Time complexity of lists

Time complexity of sets

Time complexity of queues

Time complexity of maps

Collections in Kotlin

Sequences in Kotlin

Summary

Optimizing Access to Properties

Fields and properties

Backing fields

Backing properties

@JvmField annotation

Properties inspection

Compile-time constants

Inner classes

lateinit

Companion objects

Summary

Preventing Unnecessary Overhead Using Delegates

Types of delegation

Explicit delegation

Implicit delegation

Class delegation

Delegated properties

Lazy

Creating a delegated property

Inspecting the lazy function

Observable delegates

Summary

Ranges and Identifying Performance Issues

Ranges in Kotlin

Utility functions

Range benchmarking

Summary

Multithreading and Reactive Programming

Concurrency and parallelism

Reactive programming

Coroutines

Setting up a project

The launch function

The async function

The buildSequence function

The suspendingSequence function

The produce function

Coroutines with reactive programming

Summary

Best Practices

The disposable pattern

Immutability

Data classes

The String pool

StringBuilder

Functional programming

Declarative versus imperative

Pure functions

First-class functions

Higher-order functions

Inline functions

Function composition

Capturing lambdas

Collections

Properties

Backing properties

@JvmField annotation

Top-level members

Compile-time constants

The lateinit modifier

Delegation

Singleton delegate object

The lazy funcation with unsafe thread mode

Delegate object with generic

Ranges

Concurrency and parallelism

Summary

Other Books You May Enjoy

Leave a review - let other readers know what you think

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

发表评论

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

买过这本书的人还买过

读了这本书的人还在读

回顶部