JavaScript Speed Trials – Post IV – JavaScript Namespaces

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

 

namespaces_5_ie.png

 

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

 

namespaves_10_ie.png

 

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

namespaces_10_extreme_ie.png

 

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.

About James McParlane

CTO Massive Interactive. Ex Computer Whiz Kid - Now Grumpy Old Guru.
This entry was posted in JavaScript, JavaScript Benchmarks. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s