Welcome! This screencast shows how to obtain, install, and use ASAP
# Create a project folder
mkdir asap
cd asap
# Clone the source code
git clone git@github.com:dslab-epfl/asap.git
git clone http://llvm.org/git/clang.git asap/tools/clang
( cd asap/tools/clang && git checkout release_35 )
git clone http://llvm.org/git/compiler-rt.git asap/projects/compiler-rt
( cd asap/projects/compiler-rt && git checkout release_35 )
# Let's build ASAP
mkdir build
cd build
# For configuring, two settings are recommended
# - -G Ninja finishes the build sooner (you want your build ASAP, after all :) )
# - -DLLVM_ENABLE_ASSERTIONS=ON makes bugs a bit easier to understand
cmake -G Ninja -DLLVM_ENABLE_ASSERTIONS=ON ../asap
cmake --build .
# ASAP was built. Now let's try things out!
# Here, we add ASAP to the path so that we can more easily compile the benchmarks.
cd ..
PATH=$(pwd)/build/bin:$PATH
# There is a ready-to-use script to test ASAP with bzip2. It does the following:
# - Download bzip2 from the official website
# - Compile it without instrumentation (the baseline version)
# - Compile it with AddressSanitizer instrumentation.
# - Profile it. Bzip2 comes with a few tiny test files. Running these tests is good enough for ASAP.
# - Compile optimized versions with cost levels from 1% to 100%
mkdir bzip2
cd bzip2
../asap/lib/Transforms/SanityChecks/scripts/bzip2/build_bzip2.sh
# Let's inspect the result
ls -l
# We test the speed by measuring the time it takes to compress the ASAP source code
tar cf test-archive.tar ../asap/*
time ./bzip2-baseline-build/bzip2 --keep --force test-archive.tar
time ./bzip2-asan-c1000-build/bzip2 --keep --force test-archive.tar
# The baseline version took 31 seconds, whereas the AddressSanitizer-instrumented version takes 57 seconds.
# An overhead of 84%
# Let's see how ASAP reduces this overhead
time ./bzip2-asan-c0010-build/bzip2 --keep --force test-archive.tar
# ASAP has reduced the overhead to 6% (while keeping 78% of the instrumentation)
# That's it. Have a lot of fun!
More by Sjlver
Share this recording
Link
Append ?t=30
to start the playback at 30s, ?t=3:20
to start the playback at 3m 20s.
Embed image link
Use snippets below to display a screenshot linking to this recording.
Useful in places where scripts are not allowed (e.g. in a project's README file).
HTML:
Markdown:
Embed the player
If you're embedding on your own page or on a site which permits script tags, you can use the full player widget:
Paste the above script tag where you want the player to be displayed on your page.
See embedding docs for additional options.
Download this recording
You can download this recording in asciicast v1 format, as a .json file.
DownloadReplay in terminal
You can replay the downloaded recording in your terminal using the
asciinema play
command:
asciinema play 20204.json
If you don't have asciinema CLI installed then see installation instructions.
Use with stand-alone player on your website
Download asciinema player from
the releases page
(you only need .js
and .css
file), then use it like this:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="asciinema-player.css" />
</head>
<body>
<div id="player"></div>
<script src="asciinema-player.min.js"></script>
<script>
AsciinemaPlayer.create(
'/assets/20204.json',
document.getElementById('player'),
{ cols: 80, rows: 25 }
);
</script>
</body>
</html>
See asciinema player quick-start guide for full usage instructions.
Generate GIF from this recording
While this site doesn't provide GIF conversion at the moment, you can still do it yourself with the help of asciinema GIF generator utility - agg.
Once you have it installed, generate a GIF with the following command:
agg https://asciinema.org/a/20204 demo.gif
Or, if you already downloaded the recording file:
agg demo.cast demo.gif
Check agg --help
for all available options. You can change font
family and size, select color theme, adjust speed and more.
See agg manual for full usage instructions.