The intent is to do a quick review across the core modules to try to optimize them for V8, specially the low hanging fruits. So far, we have two things we want to optimize:
"delete" is evil in V8, avoid the use of delete on objects.
for more details, check this gist:
"try/catch" is slow, avoid the use of it when possible.
removing serializeClientStore method from store and tests that is not…
… needed anymore.
micro-optimization: delete on object members is VERY evil.
Just to be pedantic, your gist suggests that delete isn't the problem, but if (obj.member_doesnt_exist) is the problem.
@drewfish the gist is just a simple demostration, I do have a test based on benchmark.js that reflects the same though.
Now, about the delete vs if, the problem here is the V8 low level optimizations. The if is in every test, but only on the object that was transformed using delete the if will take longer. Apparently, by using delete, V8 will change the type of object in memory, which affects the members resolution.