Moniajoisen C++-ympäristön suorituskykypullonkaulojen analysointi
Haavisto, Topi (2022)
Haavisto, Topi
2022
Tietotekniikan DI-ohjelma - Master's Programme in Information Technology
Informaatioteknologian ja viestinnän tiedekunta - Faculty of Information Technology and Communication Sciences
This publication is copyrighted. You may download, display and print it for Your own personal use. Commercial use is prohibited.
Hyväksymispäivämäärä
2022-05-24
Julkaisun pysyvä osoite on
https://urn.fi/URN:NBN:fi:tuni-202204253522
https://urn.fi/URN:NBN:fi:tuni-202204253522
Tiivistelmä
Tässä työssä käsitellään Nokia Solutions and Networks Oy:n DCAP-ohjelmiston Kerääjä-komponentin Parsija-pluginin suorituskykyä. Työn tavoitteena on etsiä ja mahdollisuuksien mukaan korjata pluginin suorituskykypullonkauloja samanaikaisuuteen liittyen. Aiemmin toteutetuissa suorituskykymittauksissa huomattiin pluginin suorituskyvyn skaalautuvuuden olevan muihin plugineihin verrattuna merkittävästi huonompaa prosessorien tai ytimien määrän kasvaessa.
Työssä käydään läpi samanaikaisuuden teoriaa, samanaikaisen koodin suoritustekijöitä, lukkojen käyttöä jaettua dataa käsiteltäessä sekä välimuistioperaatioiden merkitystä samanaikaisessa monisäikeisessä koodissa. Myös perf-komennon käyttöä suorituskykypullonkaulojen etsimiseen esitellään.
Tutkimuksessa keskityttiin eniten CPU-aikaa kuluttavaan funktioon, jossa kriittisen alueen suojaamiseksi käytetyn yksinkertaisen spinlockin suorituskykyä vertailtiin mittausten avulla muokatun spinlockin sekä mutexin suorituskykyihin. Muokatussa spinlockissa pyrittiin ottamaan huomioon välimuistioperaatioiden vaikutuksia, minkä seurauksena ilmeisin tulos olikin funktion noin 62 % alkuperäistä nopeampi suoritusaika juuri muokattua spinlockia käytettäessä. Pluginin kokonaissuorituskyvyssä ei kuitenkaan huomattu eroa, joten tutkimuksen tavoitteen voidaan katsoa täyttyneen vain osittain. This thesis deals with the performance of the Parser plugin of the Collector component in the DCAP software by Nokia Solutions and Networks Oy. The goal is to find and if possible, fix the performance bottlenecks related to concurrency in the plugin. Previous performance measurements have shown that compared to other plugins the performance scalability of the Parser plugin is considerably worse when additional processors or cores are added.
The thesis introduces some of the theory of concurrency, the factors of concurrent code, the use of locks when handling shared data and the effects of cache operations in multithreaded code. The use of the perf command to find performance bottlenecks is also talked about.
The investigation focused on the function where the CPU spent most of its time. The performance of the spinlock protecting the critical section in the function was compared to the performances measured with a modified spinlock and a mutex. The effects of the cache operations were attempted to take into consideration with the modified spinlock which yielded the most obvious result of the measurements: the execution time of the function with the modified spinlock was about 62 % faster than the original. The total performance of the plugin was not observably changed so the goal of this thesis can only be seen as partially achieved.
Työssä käydään läpi samanaikaisuuden teoriaa, samanaikaisen koodin suoritustekijöitä, lukkojen käyttöä jaettua dataa käsiteltäessä sekä välimuistioperaatioiden merkitystä samanaikaisessa monisäikeisessä koodissa. Myös perf-komennon käyttöä suorituskykypullonkaulojen etsimiseen esitellään.
Tutkimuksessa keskityttiin eniten CPU-aikaa kuluttavaan funktioon, jossa kriittisen alueen suojaamiseksi käytetyn yksinkertaisen spinlockin suorituskykyä vertailtiin mittausten avulla muokatun spinlockin sekä mutexin suorituskykyihin. Muokatussa spinlockissa pyrittiin ottamaan huomioon välimuistioperaatioiden vaikutuksia, minkä seurauksena ilmeisin tulos olikin funktion noin 62 % alkuperäistä nopeampi suoritusaika juuri muokattua spinlockia käytettäessä. Pluginin kokonaissuorituskyvyssä ei kuitenkaan huomattu eroa, joten tutkimuksen tavoitteen voidaan katsoa täyttyneen vain osittain.
The thesis introduces some of the theory of concurrency, the factors of concurrent code, the use of locks when handling shared data and the effects of cache operations in multithreaded code. The use of the perf command to find performance bottlenecks is also talked about.
The investigation focused on the function where the CPU spent most of its time. The performance of the spinlock protecting the critical section in the function was compared to the performances measured with a modified spinlock and a mutex. The effects of the cache operations were attempted to take into consideration with the modified spinlock which yielded the most obvious result of the measurements: the execution time of the function with the modified spinlock was about 62 % faster than the original. The total performance of the plugin was not observably changed so the goal of this thesis can only be seen as partially achieved.