squarism/file_io_polyglot — pull request #1 by regexer (2014-11-28 21:19:21+00:00)
Title: Perl script for file_io_polyglot

The perl results are surprisingly fast, but I think there's something we're not measuring here. Intrigued, I ran strace on both ruby and perl, and the actual system calls are very close.

#### ruby

```
$ strace -c ruby telephones.rb gen_100k.txt
116
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
76.63 0.000141 0 11279 read
23.37 0.000043 0 5801 brk
0.00 0.000000 0 3 write
...
------ ----------- ----------- --------- --------- ----------------
100.00 0.000184 17974 145 total
```

#### perl

```
$ strace -c perl telephones.pl gen_100k.txt
116
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00 0.000131 0 11206 read
0.00 0.000000 0 1 write
0.00 0.000000 0 10 open
...
------ ----------- ----------- --------- --------- ----------------
100.00 0.000131 11372 17 total
```

Ruby is doing something extra that perl isn't, and I'm not sure how to capture it. Usually, *strace* is about as deep as I go!