3 ms·
very cool project! Out of curiosity, what is the overhead of a program with-contracts vs one without them? It kind of looks like a JIT should be able to optimiz
by riffraff 15y ago
very cool project!
Out of curiosity, what is the overhead of a program with-contracts vs one without them? It kind of looks like a JIT should be able to optimize away most of the guards.
Also, I believe other DBC platforms had options to disable run time enforcing of contracts, is this possible somehow with CFCS ?
- disnet 15y agoI haven't done any benchmarks yet so not sure. In addition to the guards I think the use of Proxies will cause some slowdown. But you're right the JIT should be able to optimize most of those guards away (maybe even someday use the guards to help in their optimizing/tracing...just speculating here, I'm not a compiler/JIT guy). If you compile with "coffee -c" (compile, no contracts) instead of "coffee -cC" (compile, with contracts) you get pure JavaScript, no contracts and no runtime checks. Exactly what vanilla CoffeeScript would have given you.