/filter -fw vs /loadbuf + filter -ww - 28/03/22 12:34 PM
It seems to me a single filter -fw call should be way faster because the lines do not have to be displayed in the window before hand (even if the window is hidden), but it's not the case.
Maybe this is wrong assumption but it seems to me that it illustrates /filter -f is not doing things as fast as /loadbuf is, any idea?
Typical average result on my machine:
Currently it's way faster to use /loadbuf + /filter -ww, that feels wrong.
Maybe this is wrong assumption but it seems to me that it illustrates /filter -f is not doing things as fast as /loadbuf is, any idea?
Code
alias testfilter { ;create 165K lines in the form "ab 123" if (!$file(bf.txt)) { var %l 165000 | while (%l) { write bf.txt $r(a,z) $+ $r(a,z) $r(1,10000) | dec %l } } var %t $ticks window -hj1000000 @w loadbuf @w bf.txt filter -ceutww 2 32 @w @w echo -sg in $calc($ticks - %t) ms clear @w %t = $ticks filter -ceutfw 2 32 bf.txt @w echo -sg in $calc($ticks - %t) ms window -c @w }
Quote
in 1825 ms
in 3338 ms
in 3338 ms