Hacker News new | ask | show | jobs
by bazillion 4829 days ago
And PHP serves an empty page faster than Go splits strings. I declare PHP the winner by default.
1 comments

I have bad news:

------------------

% time ./test.go "test1,test2,test3"

["test1" "test2" "test3"]

0.00s user 0.00s system 79% cpu 0.005 total

------------------

% time php -r ''

0.03s user 0.01s system 93% cpu 0.044 total

...and I have good news :-)

    cd ~
    > empty
    php -S localhost:8080
    ## on the other console
    time { echo -e 'GET /empty HTTP/1.1\n\n' | nc localhost 8080 >/dev/null; }
    
    real    0m0.003s
    user    0m0.001s
    sys     0m0.000s