diff options
author | David Reyna <david.reyna@windriver.com> | 2014-05-21 15:15:09 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-05-21 16:47:01 +0100 |
commit | bf9ff3de5f24ffabbf7093f0664730f22d31f191 (patch) | |
tree | d0f96704aedb500d6945f526949a6884091382da /bitbake/lib/toaster/toastergui/templates/recipes.html | |
parent | defe2271350c36605704129f4a6b9332446a1319 (diff) | |
download | poky-bf9ff3de5f24ffabbf7093f0664730f22d31f191.tar.gz |
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 <David.Reyna@windriver.com>
Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>
Conflicts:
bitbake/lib/toaster/toastergui/views.py
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastergui/templates/recipes.html')
-rwxr-xr-x | bitbake/lib/toaster/toastergui/templates/recipes.html | 20 |
1 files changed, 14 insertions, 6 deletions
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 @@ | |||
45 | <td><a href="{% url "recipe" build.pk recipe.pk %}">{{recipe.version}}</a></td> | 45 | <td><a href="{% url "recipe" build.pk recipe.pk %}">{{recipe.version}}</a></td> |
46 | <!-- Depends --> | 46 | <!-- Depends --> |
47 | <td class="depends_on"> | 47 | <td class="depends_on"> |
48 | {% if recipe.r_dependencies_recipe.all.count %} | 48 | {% with deps=recipe_deps|get_dict_value:recipe.pk %} |
49 | {% with count=deps|length %} | ||
50 | {% if count %} | ||
49 | <a class="btn" | 51 | <a class="btn" |
50 | title="<a href='{% url "recipe" build.pk recipe.pk %}#dependencies'>{{recipe.name}}</a> dependencies" | 52 | title="<a href='{% url "recipe" build.pk recipe.pk %}#dependencies'>{{recipe.name}}</a> dependencies" |
51 | data-content="<ul class='unstyled'> | 53 | data-content="<ul class='unstyled'> |
52 | {% for i in recipe.r_dependencies_recipe.all|dictsort:"depends_on.name"%} | 54 | {% for i in deps|dictsort:"depends_on.name"%} |
53 | <li><a href='{% url "recipe" build.pk i.depends_on.pk %}'>{{i.depends_on.name}}</a></li> | 55 | <li><a href='{% url "recipe" build.pk i.depends_on.pk %}'>{{i.depends_on.name}}</a></li> |
54 | {% endfor %} | 56 | {% endfor %} |
55 | </ul>"> | 57 | </ul>"> |
56 | {{recipe.r_dependencies_recipe.all.count}} | 58 | {{count}} |
57 | </a> | 59 | </a> |
58 | {% endif %} | 60 | {% endif %} |
61 | {% endwith %} | ||
62 | {% endwith %} | ||
59 | </td> | 63 | </td> |
60 | <!-- Brought in by --> | 64 | <!-- Brought in by --> |
61 | <td class="depends_by"> | 65 | <td class="depends_by"> |
62 | {% if recipe.r_dependencies_depends.all.count %} | 66 | {% with revs=recipe_revs|get_dict_value:recipe.pk %} |
67 | {% with count=revs|length %} | ||
68 | {% if count %} | ||
63 | <a class="btn" | 69 | <a class="btn" |
64 | title="<a href='{% url "recipe" build.pk recipe.pk %}#brought-in-by'>{{recipe.name}}</a> reverse dependencies" | 70 | title="<a href='{% url "recipe" build.pk recipe.pk %}#brought-in-by'>{{recipe.name}}</a> reverse dependencies" |
65 | data-content="<ul class='unstyled'> | 71 | data-content="<ul class='unstyled'> |
66 | {% for i in recipe.r_dependencies_depends.all|dictsort:"recipe.name"%} | 72 | {% for i in revs|dictsort:"recipe.name" %} |
67 | <li><a href='{% url "recipe" build.pk i.recipe.pk %}'>{{i.recipe.name}}</a></li> | 73 | <li><a href='{% url "recipe" build.pk i.recipe.pk %}'>{{i.recipe.name}}</a></li> |
68 | {% endfor %} | 74 | {% endfor %} |
69 | </ul>"> | 75 | </ul>"> |
70 | {{recipe.r_dependencies_depends.all.count}} | 76 | {{count}} |
71 | </a> | 77 | </a> |
72 | {% endif %} | 78 | {% endif %} |
79 | {% endwith %} | ||
80 | {% endwith %} | ||
73 | </td> | 81 | </td> |
74 | <!-- Recipe file --> | 82 | <!-- Recipe file --> |
75 | <td class="recipe_file">{{recipe.file_path}}</td> | 83 | <td class="recipe_file">{{recipe.file_path}}</td> |