I even made sure that my alias was called before Starbucks' so that my system wasn't recovering from running his alias.
alias bm3 {
var %start = $ticks
var %i = 1
.fopen -o gaz gazillion.txt
while (%i <= 10000) && (!$ferr) {
.fwrite gaz %i $+ $crlf
inc %i
}
.fclose gaz
echo -a (Starbucks) File handling benchmark took $calc(($ticks - %start) / 1000) seconds
}
alias bm4 {
var %start = $ticks
var %i = 1
.fopen -o gaz gazillion.txt
while (%i <= 10000) && (!$ferr) {
.fwrite -n gaz %i
inc %i
}
.fclose gaz
echo -a (hixxy) File handling benchmark took $calc(($ticks - %start) / 1000) seconds
}
alias bm {
var %i = 10
while (%i) {
bm4
bm3
dec %i
}
}..but I consistently get slower results with /fwrite -n:
(hixxy) File handling benchmark took 1.016 seconds
(Starbucks) File handling benchmark took 0.843 seconds
(hixxy) File handling benchmark took 1.016 seconds
(Starbucks) File handling benchmark took 0.844 seconds
(hixxy) File handling benchmark took 1.031 seconds
(Starbucks) File handling benchmark took 0.844 seconds
(hixxy) File handling benchmark took 1.031 seconds
(Starbucks) File handling benchmark took 0.828 seconds
(hixxy) File handling benchmark took 1.015 seconds
(Starbucks) File handling benchmark took 0.844 seconds
(hixxy) File handling benchmark took 1.031 seconds
(Starbucks) File handling benchmark took 0.828 seconds
(hixxy) File handling benchmark took 1.016 seconds
(Starbucks) File handling benchmark took 0.844 seconds
(hixxy) File handling benchmark took 1.015 seconds
(Starbucks) File handling benchmark took 0.844 seconds
(hixxy) File handling benchmark took 1.016 seconds
(Starbucks) File handling benchmark took 0.844 seconds
(hixxy) File handling benchmark took 1.031 seconds
(Starbucks) File handling benchmark took 0.828 seconds
And then ones that use an error label:
alias bm3 {
var %start = $ticks
var %i = 1
.fopen -o gaz gazillion.txt
while (%i <= 10000) {
.fwrite -n gaz %i
inc %i
}
.fclose gaz
echo -a (fwrite -n) File handling benchmark took $calc(($ticks - %start) / 1000) seconds
return
:error
reseterror
.fclose gaz
}
alias bm4 {
var %start = $ticks
var %i = 1
.fopen -o gaz gazillion.txt
while (%i <= 10000) {
.fwrite gaz %i $+ $crlf
inc %i
}
.fclose gaz
echo -a (CRLF) File handling benchmark took $calc(($ticks - %start) / 1000) seconds
return
:error
reseterror
.fclose gaz
}
alias bm {
var %i = 10
while (%i) {
bm4
bm3
dec %i
}
}(CRLF) File handling benchmark took 0.75 seconds
(fwrite -n) File handling benchmark took 0.921 seconds
(CRLF) File handling benchmark took 0.766 seconds
(fwrite -n) File handling benchmark took 0.953 seconds
(CRLF) File handling benchmark took 0.75 seconds
(fwrite -n) File handling benchmark took 0.937 seconds
(CRLF) File handling benchmark took 0.75 seconds
(fwrite -n) File handling benchmark took 0.953 seconds
(CRLF) File handling benchmark took 0.75 seconds
(fwrite -n) File handling benchmark took 0.938 seconds
(CRLF) File handling benchmark took 0.765 seconds
(fwrite -n) File handling benchmark took 0.938 seconds
(CRLF) File handling benchmark took 0.75 seconds
(fwrite -n) File handling benchmark took 0.953 seconds
(CRLF) File handling benchmark took 0.75 seconds
(fwrite -n) File handling benchmark took 0.922 seconds
(CRLF) File handling benchmark took 0.75 seconds
(fwrite -n) File handling benchmark took 0.937 seconds
(CRLF) File handling benchmark took 0.766 seconds
(fwrite -n) File handling benchmark took 0.937 seconds
My computer isn't under any serious amount of stress but considering the amount of times I've ran the benchmarks it's very unlikely that -n would get unlucky
that many times.