I’m not sure about this but have you tried simply removing the closure to see how this affects the running time?