Optuna uses CachedStorage
, a wrapper class of BaseStorage
interface, since the API calls of BaseStorage
interface tends to be expensive. However, the implementation of CachedStorage
is too complex and it's actually not a wrapper of BaseStorage
since we've introduced some private storage APIs for CachedStorage
like storage._check_and_set_param_distribution() and storage._get_trials().
So I implemented a prototype of a new simple caching mechanism to remove CachedStorage
from Optuna. The change is only about 50 lines, but it is more efficient in many situations than CachedStorage.
https://github.com/optuna/optuna/compare/master...c-bata:add-simple-inmemory-cache?expand=1
For the benchmark of the new caching mechanism, I prepared the same benchmark scenario with optuna/optuna#11