Java和PyPy运行同一段代码,对比结果. Java代码: package javatest; import java.text.DecimalFormat; import java.util.Date; public class speedTest { public static void main(String[] args) { int i = 0; int max = 2000000; Date start = new Date(); while (i++ < max) { trans…
Java和Python运行速度对比:同一个函数运行一百万次,Java耗时0.577秒,Python耗时78秒--135倍的差距. 版本:Java 8,Python 2.7.10 Java测试代码: import java.util.Date; public class test { public static void main(String[] args) { Date start = new Date(); for (int i = 0; i < 1000000; i++) …