К содержанию
РецензированоEN2024

USING ASYNCHRONOUS PROGRAMMING IN PYTHON TO IMPROVE APPLICATION PERFORMANCE

Kokalko Mykola · Senior Software Engineer at Uvik

The American Journal of Engineering and Technology · 06 · 493-503 · 2024

Аннотация

INTRODUCTION demand for high-performance applications Asynchronous programming is becoming one of capable of handling large data volumes and the key approaches to optimizing application supporting simultaneous interactions with performance in the modern era of technological numerous users. Asynchronous programming is advancement. With the increasing volume of data one solution that enables developers not only to and the growing number of users interacting with speed up task execution but also to reduce server systems in real-time, the need to process multiple resource costs by efficiently managing parallel requests concurrently has emerged. Traditional processes. This is especially crucial for developing methods of sequential task execution are not web services, APIs, analytics systems, and always capable of handling high loads, leading to applications operating in real-time. application slowdowns and reduced efficiency. In this context, asynchronous technologies have The purpose of this study is to explore methods gained particular relevance as they allow for the and tools for asynchronous programming in simultaneous execution of multiple operations Python, as well as to analyze their practical without blocking the program's main thread. application for enhancing application performance. The relevance of this topic is driven by the growing https://www.theamericanjournals.com/index.php/tajet 51 THE USA JOURNALS THE AMERICAN JOURNAL OF ENGINEERING AND TECHNOLOGY (ISSN – 2689-0984) VOLUME 06 ISSUE12 METHODS settings, specifically for managing automated synthesis via a web interface. The article explores In a broad sense, asynchronous programming in how the modular structure enables configuration Python involves executing requests without and management of processes, ensuring flexibility blocking while awaiting their completion. and scalability. Asynchronous programming in Python can be implemented using various methods, some of In Potashov A. V.'s work [5], the specifics of using which are particularly relevant for concurrency in Python for backend development of high-load web Python [1]. applications are presented. The author highlights the importance of selecting appropriate tools and Hunt J. argues [2] that asynchronous programming architectural solutions to optimize the handling of in Python provides an efficient model for handling large data volumes and ensure stability under high multiple tasks that can run concurrently without loads. The focus is on the use of asynchronous blocking the main execution of the program. technologies and parallel computations. Asynchronous tasks involving input-output operations can be effectively implemented with In the work by Wilkes M. and Wilkes M., `asyncio.sleep()`. It is important to note that the “Parallelization and Async” [9], the specifics of completion order of functions may vary depending parallel and asynchronous programming in real- on how the asyncio event loop schedules tasks. world applications are examined. The authors This behavior is crucial for task management emphasize the advantages of using parallelism to optimization, which is especially relevant when improve program execution efficiency and provide working with asynchronous iterators. examples of solving complex computational tasks. A comparison of asynchronous and multithreading The practical application of FastAPI described in approaches highlights fundamental differences. [6] demonstrates Python's asynchronous Asynchronous programming allows only one part capabilities to ensure fast and efficient responses, of the program to execute at any given moment. making it suitable for high-load applications. The For example, if function `fn1()` is temporarily "Databases" project on GitHub [8] offers paused (e.g., waiting), it does not block the entire asynchronous database support for Python, easily program, allowing other functions, such as `fn2()`, integrating with frameworks like FastAPI and to operate during that time. Thus, the system AIOHTTP. This enables non-blocking database efficiently uses CPU resources, reallocating time to operations, which is crucial for maintaining other tasks. In multithreading, however, all responsiveness in asynchronous applications. The functions, such as `fn1()`, `fn2()`, and `fn3()`, run development of real-time applications using simultaneously and can execute in parallel without Python and WebSocket is discussed in an article on waiting for each other’s completion [2]. the Habr platform [10], describing how asynchronous programming paradigms are Ganji M., Alimadadi S., and Tip F. emphasize [3] essential for real-time data handling between that in Python, the keywords `async` and `await` clients and servers, ensuring low latency in play a critical role in asynchronous programming. communication. In Hielscher M. M.'s article [4], the development of The resource “Asynchronous Processing in System LABS—a modular, open-source Python solution— Design” [11] provides an ov

Доказательный фрагмент

«INTRODUCTION demand for high-performance applications Asynchronous programming is becoming one of capable of handling large data volumes and the key approaches to optimizing application supporting simultaneous interac…»

Образец извлечения

Демо-превью

INTRODUCTION demand for high-performance applications Asynchronous programming is becoming one of capable of handling large data volumes and the key approaches to optimizing application supporting simultaneous interac… Полный текст публикации CiteX не хранит — доступ к первоисточнику открывается по DOI согласно лицензии издателя и выбранному плану.

Цитирований
0
Тип
Журнал
Страна
Узбекистан
Ключевые слова
Asynchronous programming, Python, ThreadPoolExecutor, asyncio
Открыть DOI
Спросить CiteX об этой работе

Смежные источники