IIFE & Best Practices = Improving Efficiency?

On Friday, I spent some time reorganizing the AngularJS application that I have been working on over the past few weeks. My refactoring focuses on 4 fairly specific areas:

  • wrapping all my AngularJS code in IIFE,
  • reorder my controller code so that I exclude virtual functions in favor of assigning functions to members with the same name in my controller,
  • cleaning up any problems by adding "use strict"; to all my js files in the appropriate places and
  • Eliminating the use of a global application variable. Everything went well and presented fewer problems than I expected.

After I completed the above work, I was amazed at the performance improvement that my application apparently provided. The application uses Angular material quite heavily, and the AM components, which seemed somewhat sluggish, were noticeably faster. Is this performance improvement expected?

+6
source share

All Articles