Optimizations to preprocessor's find_define().
- don't check for __FILE__ and __LINE__ until after we've checked our hash,
since this is the less likely case.
- Check against the hard-coded hash value of the strings "__FILE__" and
"__LINE__" to avoid unnecessary strcmp() calls.
This dropped the profile of this function from 20% of our total CPU time to
10%. Of that 10%, 70% is now the hashing function.
#!/bin/sh
# !!! FIXME: use this to correct our estimates some day.
for feh in shaders/??_?_?/*.bytecode ; do
DISASM=`echo $feh |perl -w -p -e 's/bytecode\Z/disasm/;'`
MINE=`./cmake-build/testparse d3d $feh |grep "INSTRUCTION COUNT: " |perl -w -p -e 's/\AINSTRUCTION COUNT: //;'`
THEIRS=`grep "instruction slots used" $DISASM |perl -w -p -e 's#\A// approximately (\d+) instruction slots used .*?\Z#$1#;'`
if [ "x$MINE" != "x$THEIRS" ]; then
echo "$feh $MINE vs. $THEIRS"
fi
done