Issue from the Project Heist production:
Opening the material selector after reloading files would cause long UI freezes, because some linked in materials don't have the preview stored in the source file. So Blender would keep rerendering it after every file load.
Implemented here: Skip rendering previews of linked IDs, unless it's a solid mode render (which is usually fast). Not having a preview is not a big issue, a long reoccuring UI freeze is.
I also have a proof of concept patch for saving the rendered icons in the OS thumbnail cache. But I'm not happy with the implementation, the related code is already a mess and introducing this makes it considerably worse. This workaround is simple and reasonable enough.
Hopefully shader compilation won't be so much of an issue in the near-ish future anymore, the workaround can be removed then.