Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Extreme tests on the  delete operator of JavaScript Wayne Lee, June 2009 http:// trilancer.wordpress.com /
Why <ul><li>Find out various JavaScript Engines’ memory mgmt characteristics </li></ul><ul><li>Understand the importance o...
Approach <ul><li>Plain JavaScript code to </li></ul><ul><ul><li>Add  named  attributes  to Object X </li></ul></ul><ul><ul...
3 Different Test Methods <ul><li>Test A: Add 1 attribute to X, then delete immediately    Repeat 1000s times </li></ul><u...
Testing Configuration <ul><li>Windows XP SP3 </li></ul><ul><li>Intel Core Duo 2.16GHz CPU </li></ul><ul><li>2GB RAM </li><...
IE7 <ul><li>A: 221s </li></ul><ul><li>B: 202s </li></ul><ul><li>C: 112s </li></ul>~700MB ~700MB ~70MB
Firefox 3.0.10 <ul><li>A: 5.2s </li></ul><ul><li>B: 6.3s </li></ul><ul><li>C: 3.4s </li></ul>~200MB ~210MB ~70MB
Safari 4 <ul><li>A: 1.5s </li></ul><ul><li>B: 3.9s </li></ul><ul><li>C: 2.1s </li></ul>~230MB ~240MB (flat)
Chrome 2.0.172.30 <ul><li>A: 1.3s </li></ul><ul><li>B: 4.7s </li></ul><ul><li>C: 3.7s </li></ul>~70MB (flat) ~70MB
Show Altogether <ul><li>A </li></ul><ul><li>B </li></ul><ul><li>C </li></ul>IE7 FF3 Safari 4 Chrome 2
<ul><li>Fastest </li></ul><ul><li>Smallest  memory footprint </li></ul><ul><li>Most  effective GC </li></ul>Preliminary Co...
Hints <ul><li>Safari 4, FF3, Chrome 2 are all ideal platforms for complex web apps </li></ul><ul><ul><li>IE7    No </li><...
Notes <ul><li>Results  NOT  gained in “ clean ” environment </li></ul><ul><ul><li>Background processes, browser plugins … ...
Further Tests … <ul><li>Delete variable / attribute: global vs. local </li></ul><ul><li>Safari vs. Firefox on Mac OS </li>...
Discussions http://trilancer.wordpress.com/2009/06/10/extreme-testing-of-javascript-delete-operator-on-different-browsers/
Upcoming SlideShare
Loading in …5
×

Extreme tests of JavaScript delete operator

2,926 views

Published on

A series of tests around JavaScript delete operator and memory management on major browser platforms

Published in: Technology, Design
  • Be the first to comment

  • Be the first to like this

Extreme tests of JavaScript delete operator

  1. 1. Extreme tests on the delete operator of JavaScript Wayne Lee, June 2009 http:// trilancer.wordpress.com /
  2. 2. Why <ul><li>Find out various JavaScript Engines’ memory mgmt characteristics </li></ul><ul><li>Understand the importance of delete operator </li></ul>
  3. 3. Approach <ul><li>Plain JavaScript code to </li></ul><ul><ul><li>Add named attributes to Object X </li></ul></ul><ul><ul><li>Then delete them </li></ul></ul><ul><ul><li>Meanwhile, benchmark the time spent </li></ul></ul><ul><ul><li>And memory footprint </li></ul></ul>
  4. 4. 3 Different Test Methods <ul><li>Test A: Add 1 attribute to X, then delete immediately  Repeat 1000s times </li></ul><ul><li>Test B: Bulk add 1000s of attributes, then bulk delete them </li></ul><ul><li>Test C: Bulk add 1000s of attributes, then delete X only </li></ul>
  5. 5. Testing Configuration <ul><li>Windows XP SP3 </li></ul><ul><li>Intel Core Duo 2.16GHz CPU </li></ul><ul><li>2GB RAM </li></ul><ul><li>Internet Explorer 7 </li></ul><ul><li>Firefox 3.0.10 </li></ul><ul><li>Safari 4 (Windows) </li></ul><ul><li>Chrome 2.0 </li></ul><ul><li>Parameter Setting: </li></ul><ul><ul><li>Add 1,000,000 (yes, 1 million) named attributes to an Object X </li></ul></ul>
  6. 6. IE7 <ul><li>A: 221s </li></ul><ul><li>B: 202s </li></ul><ul><li>C: 112s </li></ul>~700MB ~700MB ~70MB
  7. 7. Firefox 3.0.10 <ul><li>A: 5.2s </li></ul><ul><li>B: 6.3s </li></ul><ul><li>C: 3.4s </li></ul>~200MB ~210MB ~70MB
  8. 8. Safari 4 <ul><li>A: 1.5s </li></ul><ul><li>B: 3.9s </li></ul><ul><li>C: 2.1s </li></ul>~230MB ~240MB (flat)
  9. 9. Chrome 2.0.172.30 <ul><li>A: 1.3s </li></ul><ul><li>B: 4.7s </li></ul><ul><li>C: 3.7s </li></ul>~70MB (flat) ~70MB
  10. 10. Show Altogether <ul><li>A </li></ul><ul><li>B </li></ul><ul><li>C </li></ul>IE7 FF3 Safari 4 Chrome 2
  11. 11. <ul><li>Fastest </li></ul><ul><li>Smallest memory footprint </li></ul><ul><li>Most effective GC </li></ul>Preliminary Conclusions Image: http://dezignus.com/prize-icons/
  12. 12. Hints <ul><li>Safari 4, FF3, Chrome 2 are all ideal platforms for complex web apps </li></ul><ul><ul><li>IE7  No </li></ul></ul><ul><ul><li>IE8  Not sure yet </li></ul></ul><ul><li>Explicit delete whenever possible  never assume GC can dramatically collect anything you drop behind </li></ul>
  13. 13. Notes <ul><li>Results NOT gained in “ clean ” environment </li></ul><ul><ul><li>Background processes, browser plugins … </li></ul></ul><ul><li>Memory footprint screenshots from Task Manger </li></ul><ul><ul><li>Inaccurate footprint data </li></ul></ul><ul><ul><li>Maybe influenced by other processes </li></ul></ul><ul><li>IE7 seems OK when adding just 100K (~2s) attributes, and performance drops greatly when it comes to 1M (~200s) </li></ul><ul><li>IE8 not included due to “abnormal” results </li></ul><ul><ul><li>Test A: ~200s </li></ul></ul><ul><ul><li>Test B: ~20s </li></ul></ul><ul><ul><li>Test C: ~12s </li></ul></ul>
  14. 14. Further Tests … <ul><li>Delete variable / attribute: global vs. local </li></ul><ul><li>Safari vs. Firefox on Mac OS </li></ul><ul><li>Page refresh GC test </li></ul><ul><li>Successively tests … </li></ul>
  15. 15. Discussions http://trilancer.wordpress.com/2009/06/10/extreme-testing-of-javascript-delete-operator-on-different-browsers/

×