Performance improvements for S2K