All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Reyna, David" <david.reyna@windriver.com>
To: "DAMIAN, ALEXANDRU" <alexandru.damian@intel.com>
Cc: "toaster@yoctoproject.org" <toaster@yoctoproject.org>
Subject: Re: [review-request] V2: 6137 excessive load time for All Recipes page
Date: Fri, 11 Apr 2014 18:57:54 +0000	[thread overview]
Message-ID: <5E53D14CE4667A45B9A06760DE5D13D055E71D5F@ALA-MBA.corp.ad.wrs.com> (raw)
In-Reply-To: <CAJ2CSBsXcz=5McVY9DANz-6VC3J48LhPUMSzA+Wc1XOx+BH1rg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3458 bytes --]

Yeow! All of 1 second render time on my slow host!

  1397242146.23:RECIPES
  1397242147.32 delta: 1.09702301025: RECIPES

I have updated my commit with your change:  dreyna/recipes_loadtime_6137

- David

From: Damian, Alexandru [mailto:alexandru.damian@intel.com]
Sent: Friday, April 11, 2014 11:05 AM
To: Reyna, David
Cc: BARROS PENA, BELEN; Lerner, Dave; toaster@yoctoproject.org
Subject: Re: [Toaster] [review-request] V2: 6137 excessive load time for All Recipes page

Hello,

I have a small modification to David's patch that improves the loading time about 5-fold compared to his latest version, from 5 seconds to less than 1 second on my laptop.

The trick used is to bring the whole list of dependencies for the entire recipe list in a single call, and do the match manually, instead of getting a call per recipe.

This approach allows the code to perform constant lookup times independent of number of rows.

Since I can't push to contrib on my laptop (something funky about keys), I'm attaching the patch for review.

Please let me know how it goes.

Cheers,
Alex

On Fri, Apr 11, 2014 at 5:26 PM, Reyna, David <david.reyna@windriver.com<mailto:david.reyna@windriver.com>> wrote:
Hi Belén,

> page still seems to be performing much worse than all other pages. Should
> we be trying to fix the root cause of the problem, ie. the "100*(2+2)
> foreign key lookups and filters/count"?
If we stay with the current design of the page, then I think the solution is along the lines:

  1. Add two fields to the Recipe class to hold the respective forward and reverse counts to support instant lookup. These values are fixed when the build completes so they can be consider constant for our purposes, plus they would add very little overhead to the database (if you can get this proposal past Alex). An alternate implementation to keep the database pristine is to add the ability to cache information like this in some runtime table, so that the calculation time is only spent once.

  2. Add a dynamic lookup of a given forward or reverse dependency list when one of those buttons are clicked. In this manner we only spend the list computation time when explicitly asked, not for every recipe whether they want it or not.

- David

> -----Original Message-----
> From: Barros Pena, Belen [mailto:belen.barros.pena@intel.com<mailto:belen.barros.pena@intel.com>]
> Sent: Friday, April 11, 2014 5:41 AM
> To: Reyna, David; Lerner, Dave
> Cc: toaster@yoctoproject.org<mailto:toaster@yoctoproject.org>
> Subject: Re: [review-request] V2: 6137 excessive load time for All Recipes
> page
>
> On 11/04/2014 01:44, "Reyna, David" <david.reyna@windriver.com<mailto:david.reyna@windriver.com>> wrote:
>
> >Here are the timing results on my slow host for the rendering time:
> >
> >  (a) Original: 13 seconds
> >  (b) V1      :  7 seconds
> >  (c) V2      :  4 seconds
>
> This is obviously a huge improvement. What bothers me is that the Recipes
> page still seems to be performing much worse than all other pages. Should
> we be trying to fix the root cause of the problem, ie. the "100*(2+2)
> foreign key lookups and filters/count"?
>
> Thanks!
>
> Belén
>

--
_______________________________________________
toaster mailing list
toaster@yoctoproject.org<mailto:toaster@yoctoproject.org>
https://lists.yoctoproject.org/listinfo/toaster



--
Alex Damian
Yocto Project
SSG / OTC

[-- Attachment #2: Type: text/html, Size: 10059 bytes --]

  reply	other threads:[~2014-04-11 18:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-11  0:44 [review-request] V2: 6137 excessive load time for All Recipes page Reyna, David
2014-04-11 12:40 ` Barros Pena, Belen
2014-04-11 14:20   ` Lerner, Dave
2014-04-11 15:59     ` Reyna, David
2014-04-11 16:26   ` Reyna, David
2014-04-11 18:05     ` Damian, Alexandru
2014-04-11 18:57       ` Reyna, David [this message]
2014-04-14 11:35         ` Barros Pena, Belen
2014-05-08 12:53           ` Damian, Alexandru
2014-05-15 23:36             ` Reyna, David
2014-04-11 14:24 ` Lerner, Dave

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5E53D14CE4667A45B9A06760DE5D13D055E71D5F@ALA-MBA.corp.ad.wrs.com \
    --to=david.reyna@windriver.com \
    --cc=alexandru.damian@intel.com \
    --cc=toaster@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.