php lua对比,比较Lua和Mono

您正在比较apples to oranges。 C#是一种静态类型语言,编译为CIL,它是一种字节码语言,由虚拟机运行(或通常为JITted),用于Web和独立应用程序开发。 Lua是一种动态类型的脚本语言,通常由解释器运行,通常作为可扩展的脚本语言嵌入到更大的应用程序中。

此外,您对基准的解释是错误的。条形图显示,与等效的Lua程序相比,Mono程序大约需要运行时间的十分之一。

也就是说,这种微基准测试基本没用。不要相信我的话;阅读what the Shootout itself has to say about it。你应该阅读整篇文章,但我会提出一些有趣的引文:

"The performance of a benchmark, even if it is derived from a real program, may not help to predict the performance of similar programs that have different hot spots."

"It may seem paradoxical to use an interpreted language in a high-throughput environment, but we have found that the CPU time is rarely the limiting factor; the expressibility of the language means that most programs are small and spend most of their time in I/O and native run-time code."

"Programming languages are compared against each other as though their designers intended them to be used for the exact same purpose - that just isn't so."

长话短说:选择你的语言是基于它是否能很好地完成你的想法,它是否能让你清楚地表达你的意图,是否能让你写出干净,可维护的代码;不是基于一些毫无意义的数字。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值