Space-time tradeoffs of lenses and optics via higher category theory