title: Ð ÐµÐ°Ð»Ð¸Ð·Ð°ÑÐ¸Ñ Ð¾Ð¿ÑÐ¸Ð¼Ð¸Ð·Ð°ÑÐ¸Ð¸ Stream Fusion Ð´Ð»Ñ ÑÐ·ÑÐºÐ° Kotlin
title: Ð²ÑÐ¿ÑÑÐºÐ½Ð°Ñ ÐºÐ²Ð°Ð»Ð¸ÑÐ¸ÐºÐ°ÑÐ¸Ð¾Ð½Ð½Ð°Ñ ÑÐ°Ð±Ð¾ÑÐ° Ð¼Ð°Ð³Ð¸ÑÑÑÐ°
titleType: Subtitle
title: Implementing Stream Fusion optimization for Kotlin
Creators: name: ÐÑÑÐ»Ð¾Ð², ÐÐ²Ð°Ð½
Publisher: name: Ð¡Ð°Ð½ÐºÑ-ÐÐµÑÐµÑÐ±ÑÑÐ³ÑÐºÐ¸Ð¹ Ð¿Ð¾Ð»Ð¸ÑÐµÑÐ½Ð¸ÑÐµÑÐºÐ¸Ð¹ ÑÐ½Ð¸Ð²ÐµÑÑÐ¸ÑÐµÑ ÐÐµÑÑÐ° ÐÐµÐ»Ð¸ÐºÐ¾Ð³Ð¾
Year: 2021
Subjects: ÐÑÐ¾Ð³ÑÐ°Ð¼Ð¼Ð¸ÑÐ¾Ð²Ð°Ð½Ð¸Ñ ÑÐ·ÑÐºÐ¸
ÐÑÑÐ¸ÑÐ»Ð¸ÑÐµÐ»ÑÐ½ÑÐµ Ð¼Ð°ÑÐ¸Ð½Ñ ÑÐ»ÐµÐºÑÑÐ¾Ð½Ð½ÑÐµ Ð¿ÐµÑÑÐ¾Ð½Ð°Ð»ÑÐ½ÑÐµ
Ð¿ÑÐ¾Ð³ÑÐ°Ð¼Ð¼Ð½Ð°Ñ Ð¾Ð¿ÑÐ¸Ð¼Ð¸Ð·Ð°ÑÐ¸Ñ
program optimisation

description: Ð¢ÐµÐ¼Ð° Ð²ÑÐ¿ÑÑÐºÐ½Ð¾Ð¹ ÐºÐ²Ð°Ð»Ð¸ÑÐ¸ÐºÐ°ÑÐ¸Ð¾Ð½Ð½Ð¾Ð¹ ÑÐ°Ð±Ð¾ÑÑ: Â«Ð ÐµÐ°Ð»Ð¸Ð·Ð°ÑÐ¸Ñ Ð¾Ð¿ÑÐ¸Ð¼Ð¸Ð·Ð°ÑÐ¸Ð¸ Stream Fusion Ð´Ð»Ñ ÑÐ·ÑÐºÐ° KotlinÂ». ÐÑÐµÐ´Ð¼ÐµÑÐ¾Ð¼ Ð¸ÑÑÐ»ÐµÐ´Ð¾Ð²Ð°Ð½Ð¸Ñ ÑÐ²Ð»ÑÐµÑÑÑ Ð¾Ð¿ÑÐ¸Ð¼Ð¸Ð·Ð°ÑÐ¸Ñ stream fusion Ð¸ ÐµÑ Ð¿ÑÐ¸Ð¼ÐµÐ½Ð¸Ð¼Ð¾ÑÑÑ Ðº ÑÐ·ÑÐºÑ Ð¿ÑÐ¾Ð³ÑÐ°Ð¼Ð¼Ð¸ÑÐ¾Ð²Ð°Ð½Ð¸Ñ Kotlin. Ð¦ÐµÐ»ÑÑ Ð´Ð°Ð½Ð½Ð¾Ð¹ ÑÐ°Ð±Ð¾ÑÑ ÑÐ²Ð»ÑÐµÑÑÑ ÑÐµÐ°Ð»Ð¸Ð·Ð°ÑÐ¸Ñ Ð¾Ð¿ÑÐ¸Ð¼Ð¸Ð·Ð°ÑÐ¸Ð¸ Stream Fusion Ð´Ð»Ñ ÑÐ·ÑÐºÐ° Kotlin. Ð ÑÐ°Ð¼ÐºÐ°Ñ Ð´Ð°Ð½Ð½Ð¾Ð¹ ÑÐµÐ»Ð¸ Ð±ÑÐ»Ð¸ Ð¿Ð¾ÑÑÐ°Ð²Ð»ÐµÐ½Ñ ÑÐ»ÐµÐ´ÑÑÑÐ¸Ðµ Ð·Ð°Ð´Ð°ÑÐ¸: 1. ÐÐ·ÑÑÐ¸ÑÑ ÑÑÑÐµÑÑÐ²ÑÑÑÐ¸Ðµ Ð¿Ð¾Ð´ÑÐ¾Ð´Ñ Ðº ÑÐµÑÐµÐ½Ð¸Ñ Ð¿ÑÐ¾Ð±Ð»ÐµÐ¼Ñ Stream Fusion Ð¾Ð¿ÑÐ¸Ð¼Ð¸Ð·Ð°ÑÐ¸Ð¸; 2. Ð Ð°ÑÑÐ¼Ð¾ÑÑÐµÑÑ Ð¸Ð¼ÐµÑÑÐ¸ÐµÑÑ ÑÐµÐ°Ð»Ð¸Ð·Ð°ÑÐ¸Ð¸ Ð¿ÑÐµÐ´Ð»Ð¾Ð¶ÐµÐ½Ð½ÑÑ Ð¿Ð¾Ð´ÑÐ¾Ð´Ð¾Ð²; 3. ÐÐ° Ð¾ÑÐ½Ð¾Ð²Ðµ ÑÐ°ÑÑÐ¼Ð¾ÑÑÐµÐ½Ð½ÑÑ ÑÐµÑÐµÐ½Ð¸Ð¹ Ð¿ÑÐµÐ´Ð»Ð¾Ð¶Ð¸ÑÑ ÑÐ¾Ð±ÑÑÐ²ÐµÐ½Ð½ÑÑ ÑÐµÐ°Ð»Ð¸Ð·Ð°ÑÐ¸Ñ Stream Fusion Ð¾Ð¿ÑÐ¸Ð¼Ð¸Ð·Ð°ÑÐ¸Ð¸, Ð¿ÑÐ¸Ð¼ÐµÐ½Ð¸Ð¼ÑÑ Ðº ÑÐ·ÑÐºÑ Kotlin. Ð ÑÐµÐ·ÑÐ»ÑÑÐ°ÑÐµ Ð²ÑÐ¿Ð¾Ð»Ð½ÐµÐ½Ð¸Ñ Ð²ÑÐ¿ÑÑÐºÐ½Ð¾Ð¹ ÐºÐ²Ð°Ð»Ð¸ÑÐ¸ÐºÐ°ÑÐ¸Ð¾Ð½Ð½ÑÐ¹ ÑÐ°Ð±Ð¾ÑÑ Ð±ÑÐ»Ð° Ð¿ÑÐµÐ´Ð»Ð¾Ð¶ÐµÐ½Ð° ÑÐµÐ°Ð»Ð¸Ð·Ð°ÑÐ¸Ñ Ð¾Ð¿ÑÐ¸Ð¼Ð¸Ð·Ð°ÑÐ¸Ð¸ Stream Fusion Ð´Ð»Ñ ÑÐ·ÑÐºÐ° Kotlin. ÐÐ¾Ð»ÑÑÐµÐ½Ð½Ð¾Ðµ ÑÐµÑÐµÐ½Ð¸Ðµ Ð¿Ð¾Ð·Ð²Ð¾Ð»ÑÐµÑ Ð¾Ð¿Ð¸ÑÑÐ²Ð°ÑÑ Ð¿ÑÐµÐ¾Ð±ÑÐ°Ð·Ð¾Ð²Ð°Ð½Ð¸Ñ Ð½Ð°Ð´ ÑÐ¿Ð¸ÑÐºÐ°Ð¼Ð¸ Ð»Ð°ÐºÐ¾Ð½Ð¸ÑÐ½Ð¾ Ð² ÑÑÐ½ÐºÑÐ¸Ð¾Ð½Ð°Ð»ÑÐ½Ð¾Ð¼ ÑÑÐ¸Ð»Ðµ, Ð¿ÑÐ¸ ÑÑÐ¾Ð¼ Ð¿Ð¾Ð»ÑÑÐ°Ñ Ð²ÑÑÐ¾ÐºÐ¾Ð¿ÑÐ¾Ð¸Ð·Ð²Ð¾Ð´Ð¸ÑÐµÐ»ÑÐ½ÑÐ¹ Ð¸Ð¼Ð¿ÐµÑÐ°ÑÐ¸Ð²Ð½ÑÐ¹ ÐºÐ¾Ð´ Ð² ÑÐµÐ·ÑÐ»ÑÑÐ°ÑÐµ ÐºÐ¾Ð¼Ð¿Ð¸Ð»ÑÑÐ¸Ð¸. ÐÐ° ÑÐµÑÑÐ¾Ð²ÑÑ Ð¿ÑÐ¸Ð¼ÐµÑÐ°Ñ ÑÐµÑÐµÐ½Ð¸Ðµ Ñ Ð¸ÑÐ¿Ð¾Ð»ÑÐ·Ð¾Ð²Ð°Ð½Ð¸ÐµÐ¼ Ð½Ð°Ð¿Ð¸ÑÐ°Ð½Ð½Ð¾Ð¹ Ð±Ð¸Ð±Ð»Ð¸Ð¾ÑÐµÐºÐ¸ ÑÐ°Ð±Ð¾ÑÐ°ÐµÑ Ð² ÑÑÐµÐ´Ð½ÐµÐ¼ Ð² 8 ÑÐ°Ð· Ð±ÑÑÑÑÐµÐµ Ð°Ð½Ð°Ð»Ð¾Ð³Ð¸ÑÐ½ÑÑ Ð¿ÑÐ¸Ð¼ÐµÑÐ¾Ð² Ñ Ð¸ÑÐ¿Ð¾Ð»ÑÐ·Ð¾Ð²Ð°Ð½Ð¸ÐµÐ¼ ÑÑÐµÐ´ÑÑÐ² ÑÑÐ°Ð½Ð´Ð°ÑÑÐ½Ð¾Ð¹ Ð±Ð¸Ð±Ð»Ð¸Ð¾ÑÐµÐºÐ¸ Kotlin Ð¸ Ð² 12 ÑÐ°Ð· Ð±ÑÑÑÑÐµÐµ Java Stream API, ÑÑÑÑÐ¿Ð°Ñ Ð² Ð¿ÑÐ¾Ð¸Ð·Ð²Ð¾Ð´Ð¸ÑÐµÐ»ÑÐ½Ð¾ÑÑÐ¸ Ð¸Ð¼Ð¿ÐµÑÐ°ÑÐ¸Ð²Ð½ÑÐ¼ ÑÐ¸ÐºÐ»Ð°Ð¼ Ð² Ð¾Ð±ÑÐµÐ¼ ÑÐ»ÑÑÐ°Ðµ ÑÐ¾Ð»ÑÐºÐ¾ Ð² 2 ÑÐ°Ð·Ð°.
description: The theme of the final qualifying work: Â«Implementation of Stream Fusion optimization for the Kotlin languageÂ». The subject of the research is stream fusion optimization and its applicability to the Kotlin programming language. The aim of this work is to implement Stream Fusion optimization for the Kotlin language. The following tasks were set within the subject of this research: 1. Examine existing approaches to solving the problem of Stream Fusion optimization; 2. Consider the available implementations of the considered approaches; 3. Based on the considered solutions, propose an implementation of Stream Fusion optimization applicable to the Kotlin language; As a result of the final qualifying work, an implementation of Stream Fusion optimization for the Kotlin language was proposed. The resulting solution allows to describe transformations over lists in a laconic functional style, while obtaining high-performance imperative code as a result of compilation. On test examples, the solution using the written library works on average 8 times faster than similar examples using the tools of the Kotlin standard library and 12 times faster than the Java Stream API, yielding in performance to imperative loops in the general case only 2 times.