gamechanger/objscheme — pull request #16 by kiril (2013-09-27 13:19:33+00:00)
Title: Making ObjScheme 10%+ Faster

review @confucious

I got a little bit carried away, but there are a few optimizations that have in total made a meaningful difference (10% on the SE test suite running on my RMBP).

* switched the `eval` loop to use a hashtable lookup for primary processing (rather than IF-chain)
* Moved from using `[cons car]` and `[cons cdr]` etc. (method calls) to `CAR`, `CDR`, etc. macros which make use of direct pointer access
* Switched function calling semantics from converting `ObSCons*` pointers to `NSArray*` everywhere to using the `ObSCons*` pointers directly
* reduced some recursion depth by skipping convenience functions in a few places

The last seems to have provided the largest amount of gain in tests. I also discovered that memory churn is a meaningful contributor to slowness, and that the GC phase may be taking amazing resources.