The direct cost of virtual function calls in C++

被引:31
|
作者
Driesen, K
Holzle, U
机构
[1] Department of Computer Science, University of California, Santa Barbara
关键词
D O I
10.1145/236338.236369
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
We study the direct cost of virtual function calls in C++ programs, assuming the standard implementation using virtual function tables. We measure this overhead experimentally for a number of large benchmark programs, using a combination of executable inspection and processor simulation. Our results show that the C++ programs measured spend a median of 5.2% of their time and 3.7% of their instructions in dispatch code. For ''all virtuals'' versions of the programs, the median overhead rises to 13.7% (13% of the instructions). The ''thunk'' variant of the virtual function table implementation reduces the overhead by a median of 21% relative to the standard implementation. On future processors, these overheads are likely to increase moderately.
引用
收藏
页码:306 / 323
页数:18
相关论文
共 50 条
  • [41] Veamy: an extensible object-oriented C++ library for the virtual element method
    A. Ortiz-Bernardin
    C. Alvarez
    N. Hitschfeld-Kahler
    A. Russo
    R. Silva-Valenzuela
    E. Olate-Sanzana
    Numerical Algorithms, 2019, 82 : 1189 - 1220
  • [42] C/C++ TEST
    王卫东
    电子科技, 2001, (19) : 38 - 38
  • [43] C and C++: Siblings
    Stroustrup, Bjarne
    C/C++ Users Journal, 2002, 20 (07):
  • [44] NOVT: Eliminating C plus plus Virtual Calls to Mitigate Vtable Hijacking
    Bauer, Markus
    Rossow, Christian
    2021 IEEE EUROPEAN SYMPOSIUM ON SECURITY AND PRIVACY (EUROS&P 2021), 2021, : 650 - 666
  • [45] DEVELOPING C++ NLMS - WALKING THE NDS TREE - IN C++
    CAVE, WD
    DR DOBBS JOURNAL, 1995, 20 (08): : 90 - &
  • [46] C++ Builder与Visual C++的比较
    彭军波
    科技信息, 2007, (25) : 350 - 350
  • [47] C++之父B.Stroustrup谈C++
    myan
    中文信息, 2002, (05) : 11 - 13
  • [48] The next great migration: From C++ to standard C++
    Stevens, A
    DR DOBBS JOURNAL, 1998, 23 (09): : 105 - 109
  • [49] Preliminary design of ADL/C++ - A specification language for C++
    Viswanadha, SR
    Sankar, S
    PROCEEDINGS OF THE SECOND USENIX CONFERENCE ON OBJECT-ORIENTED TECHNOLOGIES AND SYSTEMS (COOTS), 1996, : 97 - 111
  • [50] Microsoft C/C++和Borland C++编程环境比较
    周晓莉
    吴军
    微计算机应用, 1997, (03) : 174 - 176