Avoid unused variable warning in release build.
Fix slow setup of cdiff etc. Also add timing, make case 3d.