[Pharo-project] primitive 65 failures
Why does primitive 65 (#next) include a test on the position vs. read length and sometimes fall back on indexing the collection? I have been creating my own stream for serial ports, and it was driving me nuts. After staring at the obvious (the primitive was failing sooner than I expected), I finally looked at Dolphin and saw the same test and fallback. Doing the analogous things in my code left it working a lot better than it had been. What gives? Are we perhaps suffering from a primitive that fails too easily and is running slow code as a result, or is there a "valid" reason for the primitive to fail? Bill
On Tue, Sep 7, 2010 at 2:13 PM, Schwab,Wilhelm K <bschwab@anest.ufl.edu>wrote:
Why does primitive 65 (#next) include a test on the position vs. read length and sometimes fall back on indexing the collection? I have been creating my own stream for serial ports, and it was driving me nuts. After staring at the obvious (the primitive was failing sooner than I expected), I finally looked at Dolphin and saw the same test and fallback. Doing the analogous things in my code left it working a lot better than it had been.
What gives? Are we perhaps suffering from a primitive that fails too easily and is running slow code as a result, or is there a "valid" reason for the primitive to fail?
Bill, try removing use of the primitive and see if you can see any slowdown in the system. If you don't (as I've also) then perhaps the primitive is a bad idea anyway. 2¢ Eliot
Bill
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
participants (2)
-
Eliot Miranda -
Schwab,Wilhelm K