Eliminating Virtual Function Calls in C++ Programs
نویسندگان
چکیده
We have designed and implemented an optimizing source-tosource C++ compiler that reduces the frequency of virtual function calls. Our prototype implementation demonstrates the value of OO-specific optimization for C++. Despite some limitations of our system, and despite the low frequency of virtual function calls in some of the programs, optimization improves the performance of a suite of large C++ applications totalling over 90,000 lines of code by a median of 18% over the original programs and reduces the number of virtual function calls by a median factor of five. For more call-intensive versions of the same programs, performance improved by a median of 26% and the number of virtual calls dropped by a factor of 17.5. Our measurements indicate that inlining barely increases code size, and that for most programs, the instruction cache miss ratio does not increase significantly.
منابع مشابه
Testing Concurrent Java Programs using Randomized Scheduling
The difficulty of finding errors caused by unexpected interleavings of threads in concurrent programs is well known. Model checkers can pinpoint such errors and verify correctness but are not easily scalable to large programs. The approach discussed here is more scalable but less systematic. We transform a given Java program by inserting calls to a scheduling function at selected points. The sc...
متن کاملCompiler Optimization of C++ Virtual Function Calls
We describe two generic optimization techniques to improve run-time performance of C++ virtual function calls: type specification and type prediction. Both involve program analysis that results in a set of call sites to be optimized, and code transformations that replace the original dispatching mechanism in these sites by more efficient call expressions. We implement two special cases. The fir...
متن کاملMemory-Efficient Tail Calls in the JVM with Imperative Functional Objects
This paper presents FCore: a JVM implementation of System F with support for full tail-call elimination (TCE). Our compilation technique for FCore is innovative in two respects: it uses a new representation for first-class functions called imperative functional objects; and it provides a way to do TCE on the JVM using constant space. Unlike conventional TCE techniques on the JVM, allocated func...
متن کاملRegister Indirect Jump Target Forwarding
Object-oriented languages have recently become common, making register indirect jumps more important than ever. In objectoriented languages, virtual functions are heavily used because they improve programming productivity greatly. Virtual function calls usually consist of register indirect jumps, and consequently, programs written in objectoriented languages contain many register indirect jumps...
متن کاملEffect of Self-Care Education Based on Virtual Networks on Quality of Life in HIV-Positive Patients
Aims: Given the prevalence of AIDS and the need to enhance self-care programs and improve quality of life, the aim of the present study was to determine the effect of self-care education based on virtual networks on quality of life in HIV-positive patients. Materials & Methods: This clinical trial was conducted on HIV positive patients referred to the Counseling Centers for Behavioral Disorder...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1996