From bf9ff3de5f24ffabbf7093f0664730f22d31f191 Mon Sep 17 00:00:00 2001 From: David Reyna Date: Wed, 21 May 2014 15:15:09 +0100 Subject: bitbake: toaster: reduce redundant foreign key lookups Replace redundant foreign key lookups with "with" to improve all recipes page load time. Do depends pre-lookup in the view class, and use python itertation instead of filter() all to achieve x16 processing speedup. [YOCTO #6137] (Bitbake rev: a68a6dc50c11cc59e7c873414e3e22ac2644dea7) Signed-off-by: David Reyna Signed-off-by: Alexandru DAMIAN Conflicts: bitbake/lib/toaster/toastergui/views.py Signed-off-by: Richard Purdie --- .../lib/toaster/toastergui/templates/recipes.html | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'bitbake/lib/toaster/toastergui/templates/recipes.html') diff --git a/bitbake/lib/toaster/toastergui/templates/recipes.html b/bitbake/lib/toaster/toastergui/templates/recipes.html index 907b83d269..791a487a81 100755 --- a/bitbake/lib/toaster/toastergui/templates/recipes.html +++ b/bitbake/lib/toaster/toastergui/templates/recipes.html @@ -45,31 +45,39 @@ {{recipe.version}} - {% if recipe.r_dependencies_recipe.all.count %} + {% with deps=recipe_deps|get_dict_value:recipe.pk %} + {% with count=deps|length %} + {% if count %} {{recipe.name}} dependencies" data-content="
    - {% for i in recipe.r_dependencies_recipe.all|dictsort:"depends_on.name"%} + {% for i in deps|dictsort:"depends_on.name"%}
  • {{i.depends_on.name}}
  • {% endfor %}
"> - {{recipe.r_dependencies_recipe.all.count}} + {{count}} {% endif %} + {% endwith %} + {% endwith %} - {% if recipe.r_dependencies_depends.all.count %} + {% with revs=recipe_revs|get_dict_value:recipe.pk %} + {% with count=revs|length %} + {% if count %} {{recipe.name}} reverse dependencies" data-content="
    - {% for i in recipe.r_dependencies_depends.all|dictsort:"recipe.name"%} + {% for i in revs|dictsort:"recipe.name" %}
  • {{i.recipe.name}}
  • {% endfor %}
"> - {{recipe.r_dependencies_depends.all.count}} + {{count}} {% endif %} + {% endwith %} + {% endwith %} {{recipe.file_path}} -- cgit v1.2.3-54-g00ecf