A Case Study of Performance Degradation Attributable to Run-Time Bounds Checks on C++ Vector Access

被引:2
作者
Flater, David [1 ]
Guthrie, William F. [2 ]
机构
[1] NIST, Software & Syst Div, Informat Technol Lab, Gaithersburg, MD 20899 USA
[2] NIST, Stat Engn Div, Informat Technol Lab, Gaithersburg, MD 20899 USA
关键词
bounds checking; buffer overflow; C; C plus; performance; security;
D O I
10.6028/jres.118.012
中图分类号
TH7 [仪器、仪表];
学科分类号
0804 ; 080401 ; 081102 ;
摘要
Programmers routinely omit run-time safety checks from applications because they assume that these safety checks would degrade performance. The simplest example is the use of arrays or array-like data structures that do not enforce the constraint that indices must be within bounds. This report documents an attempt to measure the performance penalty incurred by two different implementations of bounds-checking in C and C++ using a simple benchmark and a desktop PC with a modern superscalar CPU. The benchmark consisted of a loop that wrote to array elements in sequential order. With this configuration, relative to the best performance observed for any access method in C or C++, mean degradation of only (0.881 +/- 0.009) % was measured for a standard bounds-checking access method in C++. This case study showed the need for further work to develop and refine measurement methods and to perform more comparisons of this type. Comparisons across different use cases, configurations, programming languages, and environments are needed to determine under what circumstances (if any) the performance advantage of unchecked access is actually sufficient to outweigh the negative consequences for security and software quality.
引用
收藏
页码:260 / 279
页数:20
相关论文
共 39 条
  • [1] Abdi Herve, 2007, Encyclopedia of measurement and statistics, P103, DOI DOI 10.4135/9781412952644
  • [2] Abrahams D., 2005, C TEMPLATE METAPROGR
  • [3] [Anonymous], 2013, LIN PROF PERF COUNT
  • [4] [Anonymous], 2010, P 3 WORKSH FUNCT HAR
  • [5] [Anonymous], 2013, PAPI SUPPORTED PLATF
  • [6] [Anonymous], 2013, 2013 IEEE INT S PERF
  • [7] [Anonymous], 2012, RAW DATA TABLE GENER
  • [8] [Anonymous], 1991, The Art of Computer Systems Performance Analysis: Techniquesfor Experimental Design, Measurement, Simulation, and Modeling
  • [9] [Anonymous], 2013, PAPI PERFORMANCE PRO
  • [10] Aygun Hayati, 2009, DUMA DETECT UNINTEND