3 ms·
0.1ms to parse a date??? Even the standard PHP string parser does 0.017ms on my 3 year old netbook. <?php $st = microtime(true); $cnt = 10000;
by imaginenore 12y ago
0.1ms to parse a date???
Even the standard PHP string parser does 0.017ms on my 3 year old netbook.
<?php
$st = microtime(true);
$cnt = 10000;
for ($i=0; $i<$cnt; $i++)
strtotime('2014-01-09T21:48:00.921000');
echo 1000 * (microtime(true) - $st) / $cnt;
Seems like this solves a non-existing issue.
- anemitz 12y agoYou can see the issue it solves pretty clearly here: https://github.com/elasticsales/ciso8601#benchmark https://github.com/elasticsales/ciso8601#benchmark Python != PHP
- imaginenore 12y agoActually both Python and PHP are ridiculously slow languages. Though Python is slower.
- illumen 12y agoSome implementations of python are slowish for some tasks. Many parts, like the module being discussed are written in C/assembly/fortran/Java. Python with a jit is Pypy, http://speed.pypy.org/ http://speed.pypy.org/ Also PHP has some fast _implementations_ of PHP.
- grinich 12y agoLanguages aren't slow. Interpreters are. As a human, I can think a lot faster in Python. So for me, it's a faster language.
- philfreo 12y agoThis also doesn't do the same thing, since you're not constructing a DateTime object.