Why does a Java class compile differently with a blank line?

I have the following Java class public class HelloWorld { public static void main(String []args) { } } When I compile this file and run a sha256 on the resulting class file I get 9c8d09e27ea78319ddb85fcf4f8085aa7762b0ab36dc5ba5fd000dccb63960ff HelloWorld.class Next I modified the class and added a blank line like this: public class HelloWorld { public static void … Read more

Can you “compile” PHP code and upload a binary-ish file, which will just be run by the byte code interpreter?

I know that PHP is compiled to byte code before it is run on the server, and then that byte code can be cached so that the whole script doesn’t have to be re-interpreted with every web access. But can you “compile” PHP code and upload a binary-ish file, which will just be run by … Read more

Why is 2 * (i * i) faster than 2 * i * i in Java?

The following Java program takes on average between 0.50 secs and 0.55 secs to run: public static void main(String[] args) { long startTime = System.nanoTime(); int n = 0; for (int i = 0; i < 1000000000; i++) { n += 2 * (i * i); } System.out.println((double) (System.nanoTime() – startTime) / 1000000000 + ” … Read more