← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1412971] Re: Reduce the number of document jquery objects created

 

** Changed in: horizon
       Status: Fix Committed => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Dashboard (Horizon).
https://bugs.launchpad.net/bugs/1412971

Title:
  Reduce the number of document jquery objects created

Status in OpenStack Dashboard (Horizon):
  Fix Released

Bug description:
  The horizon codebase regularly creates jQuery objects based on the
  document (`$(document)`). This can happen many times in the same
  scope. For example,
  https://github.com/openstack/horizon/blob/1385db8d1f8358aca190a40ed4c341bfc3e46f56/horizon/static/horizon/js/horizon.instances.js
  shows it happening 8 different times.

  This could be done once, saved to a variable, and then reused.
  Creating a jQuery object isn't cheap. By doing it many times as
  opposed to 1 we are causing more logic to fire, more memory to be
  allocated, and more work to happen in the browsers garbage collection.

  By moving to a single variable and repeatedly using it we will use
  less memory, cause horizon to be faster, and other performance
  benefits.

To manage notifications about this bug go to:
https://bugs.launchpad.net/horizon/+bug/1412971/+subscriptions


References