TheNitelyfe commented on a Page, Lag  -  Mar 10, 2010

napa, I tend to not use pipes as this slows down scripts, probably not noticeably but it has to split up the line then read it, I made this script to work as fast as it could.
This is something people tend to get confused about. That is only true in large snippets, not something as little as 176 bytes (napa's example with pipes). For example: load these two scripts.

alias e.me {
  var %x $ticks
  echo -a hi
  echo -a $right($calc(($ticks - %x) / 1000),2) ms
}
alias e.me2 { var %x $ticks | echo -a hi2 | echo -a $right($calc(($ticks - %x) / 1000),2) ms }

output:

hi
15 ms
hi2
15 ms

As you can see, they're both going to out put 15 ms, and this is only because /echo -a tends to slow down things. Now I'm not encouraging you to use pipes, by all means avoid them (since it's a good scripting technique anyway), but they're frowned upon MAINLY because they make your scripts look like a mess, they only slow down your script if it's a large one with a lot of pipes.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.