mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-04 10:18:31 +00:00
Print warning when microbenchmarking w/ powersave
RDTSC on Linux has so much jitter when the CPU is in powersave mode causing things like microbenchmarks to have a 1000% margin of error
This commit is contained in:
parent
41c86fe86b
commit
c6d8e516b2
5 changed files with 64 additions and 4 deletions
|
@ -642,6 +642,7 @@ int LuaBenchmark(lua_State *L) {
|
|||
luaL_checktype(L, 1, LUA_TFUNCTION);
|
||||
count = luaL_optinteger(L, 2, 100);
|
||||
maxattempts = luaL_optinteger(L, 3, 10);
|
||||
__warn_if_powersave();
|
||||
lua_gc(L, LUA_GCSTOP);
|
||||
|
||||
for (attempts = 0;;) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue