I was discussing performance implications of using the Builder pattern within Java with a colleague and while doing research I came across an interesting answer:
https://stackoverflow.com/a/2448624/3049628
But the Java-VM does optimize very strongly, especially the Server-VM (java -server), so the VM may optimize away the builder completely.
Is this true? I tried doing some google searches to support this claim and couldn't find anything. Are some JVMs really smart enough to detect a Builder object and bypass it in cases where it is feasible to do so? If so which JVMs support this?