memoize specString

I haven't done any benchmarks, but this will quite obviously improve performance.