caching inputs length