1#!/bin/bash 2CXX=clang++ 3FONT=fonts/NotoNastaliqUrdu-Regular.ttf 4TEXT=texts/fa-monologue.txt 5 6$CXX ../util/hb-shape.cc ../util/options.cc ../src/harfbuzz.cc \ 7 -lm -fno-rtti -fno-exceptions -fno-omit-frame-pointer -DHB_NO_MT \ 8 -I../src $FLAGS $SOURCES \ 9 -DPACKAGE_NAME='""' -DPACKAGE_VERSION='""' \ 10 -DHAVE_GLIB $(pkg-config --cflags --libs glib-2.0) \ 11 -o hb-shape -g -O2 # -O3 \ 12 #-march=native -mtune=native \ 13 #-Rpass=loop-vectorize -Rpass-missed=loop-vectorize \ 14 #-Rpass-analysis=loop-vectorize -fsave-optimization-record 15 16# -march=native: enable all vector instructions current CPU can offer 17# -Rpass*: https://llvm.org/docs/Vectorizers.html#diagnostics 18 19#sudo rm capture.syscap > /dev/null 20#sysprof-cli -c "./a.out $@" 21#sysprof capture.syscap 22 23perf stat ./hb-shape -o /dev/null $FONT --text-file $TEXT --num-iterations=100 --font-funcs=ot 24#perf record -g ./hb-shape -O '' -o /dev/null $FONT --text-file $TEXT --num-iterations=100 --font-funcs=ot 25#perf report -g 26