Optimize dependency generation.