I am creating a simple file manager for a CMS. I included a function that calculates the total size of a folder, but I noticed that it increases load times considerably.
The first thing that came up was an option to enable or disable performing those calculations and only display the size of individual files. But now I am thinking about the impact it would have on the server when, at some point and hypothetically speaking, the option is activated and in the directory there is a folder whose size is 1 TB or more (assuming that the file system allows it).
What do you think would happen to the server if it received a request to perform those big calculations? Would it be better to remove the option?