scalaz/scalaz — pull request #624 by plokhotnyuk (2014-01-13 21:39:06+00:00)
Title: Improve actor implementation

Here is 1st step of improvements which, I think, can be backported to 7.0.x and provide:
- decreasing of memory usage down to 104 bytes for minimal actor with empty message queue (on 64-bit JVM that running by default with -XX:+UseCompressedOops option) & speed up of actor instantiation in ~2x times by removing of redundant fields
- improving of throughput by decreasing number of memory fences due no more atomic ops for removed suspended flag and tail fields
- cleaning of code by removing of 'var' definition & explicit definition of last try scheduling step instead of 'if (n ne t)' trick in the current implementation

Here is example of benchmark results for proposed and current implementation accordingly:
https://github.com/plokhotnyuk/actors/blob/67caf4e7b8fe4b3be6542b5d4eadccfa2e588e07/out3_poolSize10.txt#L995
https://github.com/plokhotnyuk/actors/blob/67caf4e7b8fe4b3be6542b5d4eadccfa2e588e07/out3_poolSize10.txt#L1037

Lot of thanks to @sonenko, @exlevan, @folone, @t3hnar, @ancane, to my family and all others not mentioned here, but great people, which helped me during developing of these improvements