Photos app says optimizing library?

So I just upgraded my ipad to IOS 18 and my photos app says it’s optimizing my library and it’s currently 24% done and it will finish overnight while charging. Whats it doing? Is it something new to IOS 18 or is it just something I never noticed before?