in reply to Faster push and shift

You could drop the chomp as you don't need it, your regex doesn't care about the line ending. As BrowserUk points out doing anything millions of times adds up, so it might reduce your runtime a little.

Also, as you don't use the first value, you might be able to write your regex as just /\t(\d+)/ , assuming that your file is completely regular and doesn't have any odd lines or comments in it ;)