On 24 December 2013 12:29, Alexander Gladysh <[email protected]> wrote: > On Tue, Dec 24, 2013 at 6:22 PM, Alexander Gladysh <[email protected]> wrote: >> On Tue, Dec 24, 2013 at 5:39 AM, Hisham <[email protected]> wrote: >>> On 23 December 2013 20:22, Alexander Gladysh <[email protected]> wrote: >>>> On Tue, Dec 24, 2013 at 2:01 AM, Alexander Gladysh <[email protected]> >>>> wrote: >>>>> On Tue, Dec 24, 2013 at 1:34 AM, Alexander Gladysh <[email protected]> >>>>> wrote: >>>> >>>>>> $ luarocks list | grep '^[^ ]' | tail -n +4 | xargs -n1 luarocks show >>>>>> | grep code.exports >>>>>> >>>>>> This command takes five seconds to execute on my box with 74 rocks >>>>>> installed. This is way to slow for my tool. :-( >>>>> >>>>> To compare, this hack takes 0.2s: >>>>> >>>>> $ (cd `luarocks path | grep LUA_PATH | cut -d "'" -f 2- | cut -d "?" >>>>> -f 1` && find . -wholename '*code/exports.lua' | cut -c 3-) >>>> >>>> 2.1.1 with porcelain is just as slow... >>> >>> The fastest method, I think, would be to scan the manifest file: >>> >>> lua -e "dofile('/your/lib/luarocks/rocks/manifest'); for k,_ in >>> pairs(modules) do if k:match("code.exports") then print(k) end end" > > $ luajit -e 'dofile("/opt/local/share/luarocks/lib/luarocks/rocks/manifest"); > for k, _ in pairs(modules) do if k:find("code.exports", nil, true) > then io.write(k, "\n") end end' > > This command takes 0.03s on my machine. Much better! > > Why is the LuaRocks invocation so slow then?
No idea, I never profiled it or particularly coded LR to be fast (only to be portable and have minimal/no dependencies). Do you have luafilesystem, etc installed? It runs slowly when using the bootstrap command-line tools, and much faster with the internal Lua modules. -- Hisham ------------------------------------------------------------------------------ Rapidly troubleshoot problems before they affect your business. Most IT organizations don't have a clear picture of how application performance affects their revenue. With AppDynamics, you get 100% visibility into your Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro! http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk _______________________________________________ Luarocks-developers mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/luarocks-developers
