Skip to content

cterrazas2/battle-of-the-compilers

Repository files navigation

Battle of the Compilers: A Survey of C++ Compilers

Authors

  • Rabia Akhtar
  • Emily Jin
  • Chris Terrazas

Battle of the Compilers is written in C++ and surveys four top C++ compilers: G++, Clang, Intel C++, Microsoft C++. We measure three aspects of the compilers performance: compile time, run time, and executable file size. To be able to understand this tutorial, first read the Design Document to understand the previous research, design decisions, and structure of the test suites. Then read the documentation of all of the files in our test suite in the documentation folder.

Requirements

All source code was tested and compiled with C++17. The testing system currently utilizes Makefiles in each target directory along with Shell scripts.

Documentation

There is substantial documentation for each of the data structures and algorithms tested. Within these documents you can view the numerous functions utilized along with their specifics.

You can find the documentation here.

Data

We have collected various amounts of data utilizing the Intel SDE along with our own analysis via the test suites. All data is stored in the IntelSDE_Data directory.

You can find all the data here.

Running Test Suites

There are two options to run the test suites.

  • Run individual test suites within a specific directory:
    $ make for compilation.
    $ make suites for execution of program.
  • Run all test suites from top level of project directory:
    $ sh RunTestSuites.sh for compilation and execution of all test suites.
  • No test suites were written for the Microsoft compiler. Those tests must be compiled and executed manually in the Developer Command Prompt for VS with the following commands:
    cl /std:c++17 /O2 /d2cgsummary /FAs /Fa<assemblyFile> <sourceFile> for compilation.
    <program_name> 2>buf.txt for exectution of program.

Running Intel SDE

There are two main tools we use in the Intel SDE. We use the Histogram Tool and the XED Disassembler. Here is an example of how to to generate the necessary files for the list data structure into the IntelSDE_Data directory on MacOS:

### For the Histogram File ###
 $ ./sde -mix -omix ~/cpp-class-project/IntelSDE_Data/DataStructures/list/g++list/sde-mix-out-g++_list.txt -iform -- ~/cpp-class-project/DataStructures/list/list_gcc
 $ ./sde -mix -omix ~/cpp-class-project/IntelSDE_Data/DataStructures/list/clangg++list/sde-mix-out-clangg++_list.txt -iform -- ~/cpp-class-project/DataStructures/list/list_clang
 $ ./sde -mix -omix ~/cpp-class-project/IntelSDE_Data/DataStructures/list/icpclist/sde-mix-out-icpc-list.txt -iform -- ~/cpp-class-project/DataStructures/list/list_intel

### For the XED Disassembler File ###
 $ ./xed -i ~/cpp-class-project/DataStructures/list/list_gcc > ~/cpp-class-project/IntelSDE_Data/DataStructures/list/g++list/g++dis-list.txt
 $ ./xed -i ~/cpp-class-project/DataStructures/list/list_clang > ~/cpp-class-project/IntelSDE_Data/DataStructures/list/clang++list/clang++dis-list.txt
 $ ./xed -i ~/cpp-class-project/DataStructures/list/list_intel > ~/cpp-class-project/IntelSDE_Data/DataStructures/list/icpclist/icpcdis-list.txt

On Windows 10:

### For the Histogram File ###
sde -mix -omix "C:\Users\<username>\cpp-class-project\IntelSDE_Data\DataStructures\list\msvc\sde-list-ms.txt" -iform -- "C:\Users\<username>\cpp-class-project\DataStructures\list\list.exe"

### For the XED Disassembler File ###
xed -i "C:\Users\<username>\cpp-class-project\DataStructures\list\list.exe" > "C:\Users\<username>\cpp-class-project\IntelSDE_Data\DataStructures\list\msvc\xed-list-ms.txt"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •