摘要

Data structure selection and their tuning are one of the most critical aspects of developing effective applications. By analyzing data structures' behavior and their interaction with the rest of the application, tools can make suggestions for alternative data structures. Such a process is quite dependent on the execution efficiency of the data structure on a given architecture. Consequently, developers can optimize their data structure usage to make the application conscious of an underlying architecture and a particular program input.
This paper presents the design and evaluation of Brainy, a new program analysis tool that automatically selects the best data structure for a given program on a specific microarchitecture. The data structures' interface functions are instrumented to dynamically monitor how the data structure interacts with the application for a given input. The instrumentation records traces of various runtime characteristics including underlying architecture-specific events. These generated traces are analyzed and fed into an offline model constructed using machine learning; this model then selects the best data structure. That is, Brainy exploits runtime feedback of data structures to understand the situation an application runs on, and selects the best data structure for a given application/input/architecture combination based on the constructed model. The empirical evaluation shows that this technique is highly accurate across several real-world applications with various program input sets on two different state-of-the-art microarchitectures. Consequently, Brainy achieved an average performance improvement of 27% and 33% on both microarchitectures, respectively.

  • 出版日期2011-6