STUDY OF FACTORS INFLUENCING THE SPEED OF CALLING PROCEDURES, LANGUAGE C++

Геворк Асланов, G. Aslanov, Лаура Сугарова, Laura Sugarova
{"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}
引用次数: 0

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.
研究影响程序调用速度的因素,c++语言
本文是对c++优化程序代码中宏替换最优策略确定工作的延续。例程的宏替换是将函数代码部署到所有调用的地方。文章描述了实验结果,确定了影响子程序运行速度的因素。最初,人们认为函数调用时间受到函数堆栈分配时间和将控制转移到函数的时间的影响。结合实验结果表明,与分配内存的时间相比,转移控制的时间是不显著的。分配函数的堆栈内存的时间取决于函数使用的代码量和堆栈对象的数量。为了优化程序的速度,可以使用两种宏替换。第一种是使用特殊的c++语言修饰符(in-line/__forceinline),第二种是直接替换调用位置的代码。除了程序员必须控制代码替换策略中的错误外,这些方法的有效性几乎没有区别。因此,实验中选择了使用特殊改性剂的方法。选择修饰符__forceinline,因为在典型的内联中,如果编译器的优化算法不需要,编译器可能会忽略程序员的建议而不进行宏替换。__forceinline保证应用宏替换。结合所获得的结果,可以得出结论,宏替换显着提高了程序的速度,但可能导致可执行文件大小的增加。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信