https://github.com/mmomtchev/cpp-exceptions-cost
The true cost of C++ exceptions
https://github.com/mmomtchev/cpp-exceptions-cost
Last synced: 5 months ago
JSON representation
The true cost of C++ exceptions
- Host: GitHub
- URL: https://github.com/mmomtchev/cpp-exceptions-cost
- Owner: mmomtchev
- Created: 2024-06-19T10:44:39.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-23T12:06:47.000Z (over 1 year ago)
- Last Synced: 2025-05-10T19:42:39.923Z (5 months ago)
- Language: C++
- Size: 802 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# The cost of C++ exceptions
This is the code for my medium article
# Building
You will need `meson` on Linux.
## `gcc`
```shell
meson setup gcc
meson compile -v -C gcc
```## `clang`
You must install `clang`.
```shell
CC=clang CXX=clang++ CFLAGS=-funroll-loops CXXFLAGS=-funroll-loops meson setup clang
meson compile -v -C clang
```## Intel OneAPI
A very good compiler that few people use because it is not the default one on any OS. Available for Linux in a Debian/Ubuntu and RedHat style-repositories. Uses the `g++` runtime and library. Replace `12` with your `g++` version.
```shell
CC=/opt/intel/oneapi/compiler/latest/linux/bin/icx \
CXX=/opt/intel/oneapi/compiler/latest/linux/bin/icpx \
CFLAGS=--gcc-install-dir=/usr/lib/gcc/x86_64-linux-gnu/12 \
CXXFLAGS=--gcc-install-dir=/usr/lib/gcc/x86_64-linux-gnu/12 \
meson setup oneapi
meson compile -v -C oneapi
```# Run
```shell
cd {gcc|clang|oneapi}
bash ../run.sh
```