- Learning Concurrency in Kotlin
- Miguel Angel Castiblanco Torres
- 219字
- 2021-08-05 10:46:42
I/O-bound
I/O-bound, on the other hand, are algorithms that rely on input/output devices, so their execution times depend on the speed of those devices, for example, an algorithm that reads a file and passes each word in the document to filterPalindromes() in order to print the palindromes in the document. Changing a few lines of the previous example will do:
fun main(args: Array<String>) {
val words = readWordsFromJson("resources/words.json")
filterPalindromes(words).forEach {
println(it)
}
}
The readWordsFromJson() function will read the file from the filesystem. This is an I/O operation that will depend on the speed at which the file can be read. If the file is stored in a hard drive, the performance of the application will be worse than if the file is stored in an SSD, for example.
Many other operations, such as networking or receiving input from the peripherals of the computer, are also I/O operations. Algorithms that are I/O-bound will have performance bottleneck based on the I/O operations, and this means that optimizations are dependent on external systems or devices.
- 編程卓越之道(卷3):軟件工程化
- FreeSWITCH 1.6 Cookbook
- Python測(cè)試開(kāi)發(fā)入門與實(shí)踐
- 機(jī)器人Python青少年編程開(kāi)發(fā)實(shí)例
- Learning ELK Stack
- Drupal 8 Module Development
- Learning Probabilistic Graphical Models in R
- 西門子S7-200 SMART PLC編程從入門到實(shí)踐
- Python算法詳解
- Mastering HTML5 Forms
- Learning C++ by Creating Games with UE4
- Python編程入門(第3版)
- ASP.NET Core and Angular 2
- Clojure Data Structures and Algorithms Cookbook
- Manage Your SAP Projects with SAP Activate