Im currently looking at JSCocoa for an experimental app im currently doing where i want to be able to write OpenGL code and live see the result of it. But at the same time i would like to as well be able to interact with the cocoa layer from javascript. So JSCocoa seems like the right pick for it. But i got some questions!
1. Performance, calling c functions (opengl) with BridgeSupport is very slow, so i wrapped the calls in objective-c calls which was much faster. But what would be the fastest way to call OpenGL C functions calls? Any ideas? Compared to mozilla spideweb interacting with c calls I havent been able to get it as fast. I've been comparing calling the same opengl function call (that draws a rectangle on screen) 10.000 times, and SpiderWeb is at least 10x faster doing it. When profiling there is alot of overhead looking up the objective-c selector (of course). Any smart ways of minimizing this for a defined set of functions? Some sort of caching for example (its the same javascript code that is called every frame)
2. Thead safety, i'm currently calling JSCocoa evaulate from a secondary opengl thread. Is this safe? I'm getting some exc_bad_access some times?
Hope somebody with knowledge in JSCococa has some input for this!
Jonas