Геворк Асланов, G. Aslanov, Лаура Сугарова, Laura Sugarova
{"title":"研究影响程序调用速度的因素,c++语言","authors":"Геворк Асланов, G. Aslanov, Лаура Сугарова, Laura Sugarova","doi":"10.30987/ARTICLE_5C387D60657774.94658729","DOIUrl":null,"url":null,"abstract":"This article is a continuation of one work to determine the optimal strategy of macro-replacement in the optimization program codes of C++. Macro-replacement for routines is to deploy the function code in all the places her call. The article describes the results of experiments to determine the factors affecting the speed of subroutines. Initially, it was believed that function call times are affected by the time the function stack is allocated and the time to transfer control to the function. In connection with the results of the experiment, it was established that the time for transfer of control is insignificant compared to the time of allocation of memory. The time that the stack memory of a function allocated depends on the amount of code and the number of stack objects used by the function. To optimize the speed of the program, you can use two variants of macro-replacement. The first is the use of a special C++ language modifier (in-line/__forceinline), and the second is a direct substitution of the code in the place of the call. There is almost no difference in the effectiveness of these methods, except that the programmer has to control the errors in the code substitution strategy. Therefore, the method of using a special modifier was chosen for experiments. Was selected modifier __forceinline, because in a typical inline, the compiler may ignore the programmer recommendations and not done macro-replacement, if the optimization algorithms of the compiler don't need it. And __forceinline is guaranteed to apply macro-replacement. In connection with the results obtained, it can be concluded that macro-replacement significantly increases the speed of the program but can lead to an increase in the size of the executable file.","PeriodicalId":111219,"journal":{"name":"Automation and modeling in design and management of","volume":"45 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2019-02-20","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"STUDY OF FACTORS INFLUENCING THE SPEED OF CALLING PROCEDURES, LANGUAGE C++\",\"authors\":\"Геворк Асланов, G. Aslanov, Лаура Сугарова, Laura Sugarova\",\"doi\":\"10.30987/ARTICLE_5C387D60657774.94658729\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"This article is a continuation of one work to determine the optimal strategy of macro-replacement in the optimization program codes of C++. Macro-replacement for routines is to deploy the function code in all the places her call. The article describes the results of experiments to determine the factors affecting the speed of subroutines. Initially, it was believed that function call times are affected by the time the function stack is allocated and the time to transfer control to the function. In connection with the results of the experiment, it was established that the time for transfer of control is insignificant compared to the time of allocation of memory. The time that the stack memory of a function allocated depends on the amount of code and the number of stack objects used by the function. To optimize the speed of the program, you can use two variants of macro-replacement. The first is the use of a special C++ language modifier (in-line/__forceinline), and the second is a direct substitution of the code in the place of the call. There is almost no difference in the effectiveness of these methods, except that the programmer has to control the errors in the code substitution strategy. Therefore, the method of using a special modifier was chosen for experiments. Was selected modifier __forceinline, because in a typical inline, the compiler may ignore the programmer recommendations and not done macro-replacement, if the optimization algorithms of the compiler don't need it. And __forceinline is guaranteed to apply macro-replacement. In connection with the results obtained, it can be concluded that macro-replacement significantly increases the speed of the program but can lead to an increase in the size of the executable file.\",\"PeriodicalId\":111219,\"journal\":{\"name\":\"Automation and modeling in design and management of\",\"volume\":\"45 1\",\"pages\":\"0\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2019-02-20\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"Automation and modeling in design and management of\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.30987/ARTICLE_5C387D60657774.94658729\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"Automation and modeling in design and management of","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.30987/ARTICLE_5C387D60657774.94658729","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
STUDY OF FACTORS INFLUENCING THE SPEED OF CALLING PROCEDURES, LANGUAGE C++
This article is a continuation of one work to determine the optimal strategy of macro-replacement in the optimization program codes of C++. Macro-replacement for routines is to deploy the function code in all the places her call. The article describes the results of experiments to determine the factors affecting the speed of subroutines. Initially, it was believed that function call times are affected by the time the function stack is allocated and the time to transfer control to the function. In connection with the results of the experiment, it was established that the time for transfer of control is insignificant compared to the time of allocation of memory. The time that the stack memory of a function allocated depends on the amount of code and the number of stack objects used by the function. To optimize the speed of the program, you can use two variants of macro-replacement. The first is the use of a special C++ language modifier (in-line/__forceinline), and the second is a direct substitution of the code in the place of the call. There is almost no difference in the effectiveness of these methods, except that the programmer has to control the errors in the code substitution strategy. Therefore, the method of using a special modifier was chosen for experiments. Was selected modifier __forceinline, because in a typical inline, the compiler may ignore the programmer recommendations and not done macro-replacement, if the optimization algorithms of the compiler don't need it. And __forceinline is guaranteed to apply macro-replacement. In connection with the results obtained, it can be concluded that macro-replacement significantly increases the speed of the program but can lead to an increase in the size of the executable file.