Matt.
I would be very surprised so find an ‘exec’ running quicker than ‘in-line’ code as the exec has to perform similar file ops AND start its own process.
If you are using files to read/write, be careful to ensure that a file is not being read at the same time it is written.
We use one ‘file’ interface and we timestamp the output file to the nearest hour. The ‘read’ process runs an hour ‘behind’ to avoid conflict.