1 USING: io io.encodings.ascii io.files io.files.temp math
2 math.parser kernel sequences ;
6 "sum-file.txt" temp-file ascii [
7 100000 <iota> [ number>string print ] each
11 : sum-file ( file -- n )
12 ascii [ 0 [ string>number + ] each-line ] with-file-reader ;
14 : sum-file-benchmark ( -- )
16 "sum-file.txt" temp-file sum-file 4999950000 assert=
19 MAIN: sum-file-benchmark