-
-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathstress.lua
More file actions
25 lines (20 loc) · 636 Bytes
/
stress.lua
File metadata and controls
25 lines (20 loc) · 636 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function trial(n)
local lines = {}
lines[#lines + 1] = "void fill(int* dst, int* src, long long a, int long long b) {"
for i=1,n do
lines[#lines + 1] = string.format(" dst[a+%d] = src[b+%d];", i, i)
end
lines[#lines + 1] = "}"
local final_src = table.concat(lines, "\n")
local f = io.open("stress.c", "w")
f:write(final_src)
f:close()
end
for i=1,5000 do
trial(i)
local f = assert(io.popen("cuik stress.c -lang c11 -O -c -t"))
local content = f:read("*all")
f:close()
local m = string.match(content, "Build: (%d+.%d+)")
print(string.format("%d,%s", i, m))
end