Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
This paste will be private.
public class Virt { static int a = 1; static abstract class A { abstract void foo(); } static class B extends A { void foo() { a += a / 2; } } static class C extends A { void foo() { a += 3; } } public static void main(String[]args) { bench(); } static void bench() { long t = System.currentTimeMillis(); //A y = new C(); A x = new B(); for (int i=0; i<100000000;i++) { x.foo(); } System.out.println(a); System.out.println(System.currentTimeMillis() - t); } }
From the Design Piracy series on my blog: