Hello all!
As we are closing in on the 'go live' date on our project I have spent some time on speed improvements. Always when I run performance tools on the application the objj_msgSend function comes out on top as the place where the most time is spent.
After a few days I started to think maybe I should look at this function and see what can be done. Nothing has changed with it for at least 4 years. I have now created a pull request with some speed improvements.
http://github.com/cappuccino/cappuccino/pull/2103
I need help from others to test this and get feedback on what kind of speedup or slowdown we get from this. I have seen a speedup in some cases of up to 5-10%. But does this have any other undesired effects?
Some test cases don't work but they are related to how the compiler generates code for the objj_msgSend function. Also the last flatten test case fails with out of memory for some unknown reason.
The debug objj_msgSend_set_decorators functions are not supported right now. Maybe they don't need to if we only use this speed improvement for release builds.
Ok, how is this speed improvement done?
The old objj_msgSend function always checks if the class needs to be initialized. It also checks how many arguments are passed into the method. The last check is to improve the call to the method implementation with the correct number of arguments.
These two checks are eliminated by this pull request.
Please try it out and give me feedback. I need to know if this is something I should continue to work on.
http://github.com/mrcarlberg/cappuccino/tree/fast_msg_send
Best regards,
- Martin