On 17 May 2016 at 12:18, Bart Schaefer wrote: > On Mon, May 16, 2016 at 8:01 AM, Sebastian Gniazdowski > wrote: >> >> I was testing the same input with 89k lines. The cause now >> accidentally clarified. It's about zplugin's shadowing of autoload > > Are you sure it's the wrapper and not the autoloading? It's pretty > common for the first run of an autoloaded function to be slower than > subsequent runs. I tested with zplugin and without it, and slow down occurs in first case. Also, I wanted to move a normal function outside a file to make it autoloaded function. It started to be painfully slow when used with zplugin. Luckily I can optimize for 5.1 and use normal hand-made "autoload -X" body instead of the wrapper. So zplugin's future is in general safe. Tried to construct synthetic test (attached). In general the results are inconsistent. Their order changes depending even on given run. Could came up with following alerting times: # ./aload2.zsh.txt More special autoload: ( aload_fun; ) 3,68s user 0,18s system 98% cpu 3,909 total Special autoload: ( aload_fun; ) 3,08s user 0,18s system 99% cpu 3,277 total Normal autoload: ( aload_fun; ) 3,83s user 0,18s system 99% cpu 4,026 total # ./aload2.zsh.txt More special autoload: ( aload_fun; ) 2,90s user 0,19s system 99% cpu 3,115 total Special autoload: ( aload_fun; ) 3,24s user 0,18s system 99% cpu 3,436 total Normal autoload: ( aload_fun; ) 3,62s user 0,18s system 99% cpu 3,812 total # ./aload2.zsh.txt More special autoload: ( aload_fun; ) 2,86s user 0,18s system 99% cpu 3,050 total Special autoload: ( aload_fun; ) 3,22s user 0,18s system 99% cpu 3,402 total Normal autoload: ( aload_fun; ) 3,94s user 0,19s system 99% cpu 4,148 total Best regards, Sebastian Gniazdowski