$buf is populated by gen_salva2 but instead of generating data for just one output string it generates data for 100 of them (a few less, actually). Next calls to gen_salva2 do not need to fill $buf again as it already contains data (until exhausted, then it is refilled).
That's also the reason my previous comment said it was faster on average!
In reply to Re^7: Random data generation.
by salva
in thread Random data generation.
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |