Node.js与PHP、Python的字符处理性能对比

2020-06-17 05:44:05易采站长站整理

content = f.read()

start = time.time()
instance = Chars(content)
instance.run()
end = time.time();

print (end - start)

其中 page.html 文件内容为一个长度为 的文本。

测试结果


语言 函数 类
Node.js 0.022s 0.026s
PHP 0.35s 1.02s
Python 0.58s 1.50s