This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Adapted from answer https://stackoverflow.com/a/79598751/530714 | |
to question "Example of a microbenchmark to demonstrate that code | |
inlining is not always beneficial to performance". | |
To build two variants of the code: | |
gcc -Wall -O3 -o inlinecost inlinecost.c | |
gcc -Wall -O3 -o inlinecost-unrolled inlinecost.c -DUNROLL | |
To run it and compare the latencies: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// === Before === | |
typedef enum { | |
Access_Vanilla, | |
Access_Special, | |
Access_Cache, | |
Access_Cache_L2, | |
Access_Invalid | |
} access_t; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Check spelling | |
ASPELL=$(which aspell 2> /dev/null) | |
if [ $? -ne 0 ]; then | |
echo "Aspell not installed, unable to check spelling" >&2 | |
else | |
WORDS=$(grep -v "^Change-Id:" "$1"| $ASPELL --mode=email --add-email-quote='#' list | sort -u) | |
if [ -n "$WORDS" ]; then | |
echo -ne "\e[31m" |