in reply to Time reading file size

You are effectively using the filesystem as a database and trusting that the directory-entry correctly reflects the file size. Benchmarking will probably reveal that your approach is slower. Read the preferences from the database once and keep them in memory. Don't retrieve them in a loop.

Replies are listed 'Best First'.
Re^2: Time reading file size
by htmanning (Friar) on Jan 16, 2018 at 22:03 UTC
    Thank you. I'm always leary of too many database calls, but it appears too many Apache calls can be equally, or more taxing. I have no idea how to write to particular part of a .sub file so I did the workaround.