Speed of PHP vs JavaScript?

后端 未结 3 1727
执念已碎
执念已碎 2020-12-10 02:37

I am writing a script to tokenize file contents. I\'ve written a tokenizer in JavaScript, but it gets pretty slow with large files (5+ seconds). Since I\'m retrieving the fi

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-10 02:38

    I just converted a script from PHP to Javascript and I have greatly increased performance.

    Javascript seems much faster in mathematical calculations. I have personally witnessed the performance improvement, my PHP procedure in some cases also employed a few seconds of running, while the same procedure written in javascript takes at most a few milliseconds.

    Although Javascript to be known as client-side language I run my code on the server side thanks to Node.js

提交回复
热议问题