@mattab opened this Issue on March 22nd 2012 Member

When loading the dashboard, there is a noticeable slowness since recent changes. I think there is aneasy way to make the dashboard fast again.

explanation: when loading dashboard, the following http requests are made:

  • first: index.php?module=Dashboard&action=embeddedIndex&idSite=1&period=month&date=2012-03-21
  • Then, once loaded this triggers 2 requests
    • Get dashboard layout for user: index.php?module=Dashboard&action=getDashboardLayout&idDashboard=1&token_auth=anonymous&idSite=1
    • Get available widgets: index.php?module=Dashboard&action=getAvailableWidgets&token_auth=anonymous&idSite=1
  • Then, standard widgets are displayed once these 2 are finished loading.

The requests 2) and 3) should be streamlined and included in the output of the first one module=Dashboard&action=embeddedIndex

This way, the dashboard should be fast again :-)

@sgiehl commented on March 22nd 2012 Member

I'll have a look at that.

@sgiehl commented on March 31st 2012 Member

(In [6142]) fixes #3065, refs #3011 initial version of multiple dashboard feature
refs #2857 fixed id collisions in modal confirm windows by using an role attribute instead of id

@mattab commented on May 3rd 2012 Member

(1) In trunk when loading /piwik/ there is still an extra http request: index.php?module=Dashboard&action=getAvailableWidgets&token_auth=XYZ&idSite=1

This can be seen

  • Loading data...
  • Few seconds later: & Dashboard appears
    • here request fires to getAvailableWidgets
  • 1s later: All widgets load

For performance improvement the request getAvailableWidgets could be included in the response of embeddedIndex.

(2) Also, another way to slightly improve perf: the JS that is inlined in embeddedIndex could be put instead in a JS file so that it's loaded only once in the big minified JS rather than on each dashboard load.

(3) A small UX feedback which maybe is related: after the response from getAvailableWidgets currently comes back, I can see the [Widgets&dashboard] menu moving to the right a few pixels. Instead it should be at the right position from the start so that there is no "pixel" jumping when the content loads.

@sgiehl commented on May 7th 2012 Member

(In [6253]) refs #3065 moved js code from template to additional js file

@sgiehl commented on May 7th 2012 Member

(In [6254]) refs #3065 fixes UX regression

@sgiehl commented on May 25th 2012 Member

well, it would be quite easy to include the seperate request for the widgets. But that would mean we would have to transfer that data whenever the user switches to a dashboard. that would be useless, as we need that data only once.

@mattab commented on May 25th 2012 Member

What I propose is that the request to Dashboard controller returns directly the Menu data, Widget data for the dashboard loaded by default, and layout of dashboard loaded by default.

Then when clicking on another dashboard the http request would return layout, widgets available for this dashboard in the same http request.

  • index.php?module=Dashboard&action=getAllDashboards
  • index.php?module=Dashboard&action=getAvailableWidgets

Maybe these requests still need to be made when a widget is added/ a dashboard renamed/removed. Could we then just trigger in these functions the requests above to update the json data?

Streamlining these 2 json objects in the main request to the embed dashboard will speed up embed dashboard speed quite a lot and is experienced by all users as the first thing in piwik.

@sgiehl commented on May 30th 2012 Member

(In [6409]) refs #3065 include available widgets in embeddedIndex, so no additional request is required

@sgiehl commented on May 30th 2012 Member

now index.php?module=Dashboard&action=getAvailableWidgets is not requested anymore. the allDashboards request ist not required to render the page, it only updates the dashboard list in the menu, which is allready available before.

@mattab commented on May 31st 2012 Member

Nice change!

It seems the widgets are not recorded anymore: when I add a widget to dashboard 2 it adds it to dashboard 1 as well.

  • The problem is that click on another custom dashboard does not update "idDashboard" in the menu, it is still idDashboard=1

Regarding performance:

  • getAllDashboards is not required to render, but the http request is queued before any of the widgets. Could we force the http request to queue like 1s later on ?


@mattab commented on June 1st 2012 Member

It can be improved a bit more as per previous, but definitely the main things have been fixed and it is not a blocker for release anymore. Thanks Stefan!!

@sgiehl commented on November 7th 2012 Member

I had another look at this issue and I don't think that can be improved that mutch.
Requests for widgets are already queued before the getAllDashboards request.

This Issue was closed on November 7th 2012
Powered by GitHub Issue Mirror