publicstaticGlideExecutor.BuildernewAnimationBuilder(){intbestThreadCount=calculateBestThreadCount();// We don't want to add a ton of threads running animations in parallel with our source and// disk cache executors. Doing so adds unnecessary CPU load and can also dramatically increase// our maximum memory usage. Typically one thread is sufficient here, but for higher end devices// with more cores, two threads can provide better performance if lots of GIFs are showing at// once.//我们不希望增加大量线程来并行运行动画,我们的源代码和磁盘缓存执行器。//这样做增加了不必要的CPU负载,也会大大增加了我们的最大内存使用量。//通常情况下,一个线程就足够了,但对于更高端的设备来说。//如果有更多的核心,两个线程可以提供更好的性能,如果大量的GIF显示一次。intmaximumPoolSize=bestThreadCount>=4?2:1;returnnewGlideExecutor.Builder(/*preventNetworkOperations=*/true).setThreadCount(maximumPoolSize).setName(DEFAULT_ANIMATION_EXECUTOR_NAME);}/** Shortcut for calling {@link Builder#build()} on {@link #newAnimationBuilder()}. */publicstaticGlideExecutornewAnimationExecutor(){returnnewAnimationBuilder().build();}