Micro-optimize LayoutManager

Review Request #122861 - Created March 8, 2015 and submitted

Information
Kai Uwe Broulik
plasma-desktop
master
Reviewers
plasma

This micro-optimizes the LayoutManager by:
- using Array and Object literals rather than new Object/Array, and also creating the whole structure at once if applicable
- Store end values in for loops rather than calculating them on each iteration
- Adjust coding style here and there

Moving applets (especially using Eike's press-and-hold when using it on a touchscreen :P) feels snappier, doesn't print any new warnings on console and seems to work as before. However, I can no longer cause plasmashell to go berserk when moving a small applet ontop of a huge one (eg. small sticky note on wide fuzzy clock) where it desperately tries to find a place and fails.

I think the grid size should be based on units somehow, having a 24x24 grid on a high dpi screen also benefits the aforementioned behavior.

One surprising discovery I made is that using Qt.point instead of a handcrafted JS Object is one order of magnitude(!) slower.

Issues

  • 3
  • 0
  • 0
  • 3
Description From Last Updated
I think it's more readable to init j before the loop. Sebastian Kügler Sebastian Kügler
same here Sebastian Kügler Sebastian Kügler
init j before loop for readability Sebastian Kügler Sebastian Kügler
Sebastian Kügler
Eike Hein
Sebastian Kügler
Kai Uwe Broulik
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit 26596c054dd212ce8ad4333145575414d54b08f2 by Kai Uwe Broulik to branch master.
Loading...