mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
fix(loader): disable profiling by default
This commit is contained in:
@@ -438,6 +438,13 @@ function Loader.track(stat, f)
|
||||
end
|
||||
end
|
||||
|
||||
---@class ProfileOpts
|
||||
---@field loaders? boolean Add profiling to the loaders
|
||||
|
||||
--- Debug function that wrapps all loaders and tracks stats
|
||||
---@private
|
||||
---@param opts ProfileOpts?
|
||||
function M._profile(opts)
|
||||
Loader.get_rtp = Loader.track('get_rtp', Loader.get_rtp)
|
||||
Loader.read = Loader.track('read', Loader.read)
|
||||
Loader.loader = Loader.track('loader', Loader.loader)
|
||||
@@ -447,14 +454,13 @@ Loader.load = Loader.track('load', Loader.load)
|
||||
M.find = Loader.track('find', M.find)
|
||||
Loader.lsmod = Loader.track('lsmod', Loader.lsmod)
|
||||
|
||||
--- Debug function that wrapps all loaders and tracks stats
|
||||
---@private
|
||||
function M._profile_loaders()
|
||||
if opts and opts.loaders then
|
||||
for l, loader in pairs(loaders) do
|
||||
local loc = debug.getinfo(loader, 'Sn').source:sub(2)
|
||||
loaders[l] = Loader.track('loader ' .. l .. ': ' .. loc, loader)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
--- Prints all cache stats
|
||||
---@param opts? {print?:boolean}
|
||||
|
Reference in New Issue
Block a user