Closed
Description
I am experimenting with reading the content of a bunch of files async. While doing some tests I notice that reading the files sync is a lot faster (+10 times) then doing this async with this library (using ext-eio)
Experiment:
I am monitoring (polling) 32 different sysfs files used for digital inputs (kinda like the raspberry pi). If I read them with file_get_content it takes about 2-4 milliseconds in total to read them, one by one, sync. If I use $filesystem->file($file)->getContents()
and use \React\Promise\all()
on all the promises, it takes something between 35-120 milliseconds. I would expect that reading them async would be faster, when reading multiple files.
Could somebody explain me why this is so slow?