Idea suggested by @leouieda.
Apparently xxhash is much faster than SHA256 (insert reference) when computing hashes, specially for large amount of data (such as large arrays). We could have xxhash as an optional dependency, and if it's installed we could use it in cache_on_model to hash the model. If not we can fallback to an algorithm from hashlib. Also, using md5 or sha1 should be faster than sha256, so we might want to consider using one of those instead.