diff --git a/profile.sh b/profile.sh index 38835cce..80e9ff2c 100644 --- a/profile.sh +++ b/profile.sh @@ -1,6 +1,6 @@ g++ -o pocketpy src/main.cpp --std=c++17 -pg -O2 -fno-rtti -./pocketpy benchmarks/fib.py +./pocketpy benchmarks/primes.py gprof pocketpy gmon.out > gprof.txt diff --git a/src/codeobject.h b/src/codeobject.h index a6da1833..a5175a9b 100644 --- a/src/codeobject.h +++ b/src/codeobject.h @@ -66,7 +66,7 @@ struct CodeObject { std::map labels; uint32_t perfect_locals_capacity = 2; - uint32_t perfect_hash_seed = 0xffffffff; + uint32_t perfect_hash_seed = -1; void optimize(VM* vm); diff --git a/src/namedict.h b/src/namedict.h index becabe59..2c8faac3 100644 --- a/src/namedict.h +++ b/src/namedict.h @@ -20,7 +20,7 @@ namespace pkpy{ } uint32_t find_perfect_hash_seed(uint32_t capacity, const std::vector& keys){ - if(keys.empty()) return 0xffffffff; + if(keys.empty()) return -1; std::set indices; std::vector> scores; for(int i=0; i