Optimise io requests for long message queues

Magnus Henoch <[email protected]> Fri, 27 Jun 2014 18:07:03 +0100
Newsgroups gmane.comp.lang.erlang.patches
Message-ID <[email protected]>
This patch reduces the run time of non-raw I/O when the calling process
has a long message queue, by using the monitor reference to trigger the
selective receive optimisation.

Here is a little test program:
https://gist.github.com/legoscia/e0ac1bd1f640c9489609

Without my change, the run time of the call to file:write/2 increases as
the message queue length increases, while with my patch, the run time
stays constant.

I was a bit unsure about removing the 'EXIT' clause from the receive,
but I've mostly convinced myself that this case should be fully handled
by the 'DOWN' clause, as the process in question is being monitored.

git fetch git://github.com/legoscia/otp.git io-message-queue-optimisation

https://github.com/legoscia/otp/compare/legoscia:io-message-queue-optimisation
https://github.com/legoscia/otp/compare/legoscia:io-message-queue-optimisation.patch

Regards,
Magnus
_______________________________________________
erlang-patches mailing list
[email protected]
http://erlang.org/mailman/listinfo/erlang-patches