What is the fastest way to get Resources?

With the new .GetResources function I am able to get images from an arbitrary folder under /assets/ or whatever I have specified as an assetDir in the config.

Currently I am refactoring an older project that had its content organized before Page Bundles were introduced.

So what will be the fastest way to generate a Hugo site with .Resources performance wise?

Should I use Page Bundles or will the above combo of readDir and resources.Get be fast enough? Or either way is fine?

This project is image heavy and I will be resizing hundreds of photos with Hugo. Of course I will be committing the /resources/ directory to git so the question is really about local development.

In the performance department, both should be equally fast. If you want a winner, I would say that resource.Get is possibly slightly more effective as it creates little “waste” – i.e. you only “open what you need”.

1 Like

But I don’t think there is a .GetResources function? Which makes me want to add that bundles are more feature rich when you want to build galleries – you can add metadata and filter by patterns etc.

1 Like

Of course there isn’t that was just me capitalizing the Get in the topic title (I fixed it).

Thanks for the replies. It’s good know that there is no performance hit if one doesn’t use Page Bundles.

I have found out that I can do everything I need with resources.Get

Also this approach will save me lots of time by not reorganizing this old project for Page Bundles.