3 ms·
Theory. The php script and the log in question are probably in the kernel's aggressive block layer cache. The new files created by rust are potentially new and
by contingencies 7y ago
Theory.
The php script and the log in question are probably in the kernel's aggressive block layer cache. The new files created by rust are potentially new and uncached, mean that it must be loaded from disk. Therefore the rust version is probably just losing time on disk access.
Quick test: review whether or not the rust version runs faster on the second execution.
Also or alternatively: use a profiler or copy the rust program to an in-memory block device (ramdisk) prior to access.