perf: way better compilation and caching

This commit is contained in:
Folke Lemaitre 2022-11-21 21:50:16 +01:00
parent c749404423
commit a543134b8c
No known key found for this signature in database
GPG key ID: 41F8B1FBACAE2040
6 changed files with 390 additions and 133 deletions

View file

@ -25,7 +25,7 @@ function M.track(name, time)
end
function M.time()
return vim.loop.hrtime() / 1000000
return vim.loop.hrtime()
end
function M.file_exists(file)
@ -115,7 +115,7 @@ function M.profile()
table.insert(
lines,
(" "):rep(depth) .. "- " .. entry.name .. ": **" .. math.floor((entry.time or 0) * 100) / 100 .. "ms**"
(" "):rep(depth) .. "- " .. entry.name .. ": **" .. math.floor((entry.time or 0) / 1e6 * 100) / 100 .. "ms**"
)
for _, child in ipairs(entry) do