Predicting the performance of an optimization is actually quite difficult. I myself had noticed in passing the namespace test being done at runtime, but it had never occurred to me that it would make such a dramatic difference.
You've made quite a valuable contribution by measuring the performance improvement.