Speed up digest with recursive hash
Speed up digest with recursive hash

Digest is the second most time spent while compiling assets on the first run for CodeTriage. The `if/elsif` means that for complex data structures many many comparisons are made. Instead we store the logic of digesting each class in a hash with the class name as a key. Complex data types digest themselves by recursively calling into the hash.

Is it faster?

On CodeTriage.com over 50 runs against this codebase and master it averaged 12.54s per run on this branch stdev 0.27seconds and against master it was 14.9s with a 2.045 stdev. So in the average case it makes asset generation 16% faster.
rails/sprockets,recursecenter/sprockets,prathamesh-sonpatki/sprockets,eileencodes/sprockets