A comparison of optimisation algorithms for high-dimensional particle and astrophysics applications