- Mastering Delphi Programming:A Complete Reference Guide
- Primo? Gabrijel?i?
- 481字
- 2021-06-24 12:33:28
What is performance?
To better understand what we mean when we say that a program is performing well, let's take a look at a user story. In this book, we will use a fictitious person, namely Mr. Smith, Chief of Antarctica Department of Forestry. Mr. Smith is stationed in McMurdo Base, Antarctica, and he doesn't have much real work to do. He has already mapped all the forests in the vicinity of the station and half of the year it is too dark to be walking around and counting trees, anyway. That's why he spends most of his time behind a computer. And that's also why he is very grumpy when his programs are not performing well.
Some days he writes long documents analyzing the state of forests in Antarctica. When he is doing that, he wants the document editor to perform well. By that he actually means that the editor should work fast enough so that he doesn't feel any delay (or lag, as we call the delay when dealing with user input) while typing, preparing graphs, formatting tables, and so on.
In this scenario, performance simply means working fast enough and nothing else. If we speed up the operation of the document editor by a factor of two, or even by a factor of ten, that would make no noticeable improvement for our Mr. Smith. The document editor would simply stay fast enough as far as he is concerned.
The situation completely changes when he is querying a large database of all of the forests on Earth and comparing the situation across the world to the local specifics of Antarctica. He doesn't like to wait and he wants each database query to complete in as short a time as possible. In this case, performance translates to speed. We will make Mr. Smith a happier person if we find a way to speed up his database searches by a factor a ten. Or even a factor of five; or two. He will be happy with any speedup and he'd praise us up to the heavens.
After all this hard work, Mr. Smith likes to play a game. While the computer is thinking about a next move, a video call comes in. Mr. Smith knows he's in for a long chat and he starts resizing the game window so that it will share the screen with a video call application. But the game is thinking hard and is not processing user input and poor Mr. Smith is unable to resize it, which makes him unhappy.
In this example, Mr. Smith simply expects that the application's user interface will respond to his commands. He doesn't care if the application takes some time to find the next move, as long as he can do with the application what he wants to. In other words, he wants a user interface that doesn't block.
- Windows phone 7.5 application development with F#
- Raspberry Pi 3 Cookbook for Python Programmers
- Learning Cocos2d-x Game Development
- 深入淺出SSD:固態存儲核心技術、原理與實戰(第2版)
- 數字邏輯(第3版)
- Manage Partitions with GParted How-to
- 分布式微服務架構:原理與實戰
- Spring Cloud微服務架構實戰
- 計算機組裝維修與外設配置(高等職業院校教改示范教材·計算機系列)
- Creating Flat Design Websites
- Machine Learning with Go Quick Start Guide
- Spring Cloud微服務和分布式系統實踐
- Java Deep Learning Cookbook
- Spring Cloud實戰
- 單片微機原理及應用