Continuing my analysis of JavaScript performance. For this test I’m testing the impact of the current trend of JavaScript namespaces.
Namespaces
In this test 500000 iterations of the main function are performed.
The depth of the namespace varies from 1 to 15 in increments of 1. Each namespace is 5 characters long
In this test 500000 iterations of the main function are performed.
The depth of the namespace varies from 1 to 15 in increments of 1. Each namespace is 10 characters long
In this test 500000 iterations of the main function are performed.
The depth of the namespace varies from 1 to 150 in increments of 10. Each namespace is 10 characters long
The scaling curve is not that good for stupidly high depth of namespaces, this performance curve is reflected in normal usage as you lose approximately 3% of your performance with each namespace level.