get_apt_pkg_cache is slowing update-manager down

Bug #2110300 reported by Nathan Teodosio
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Software Updater
New
Undecided
Unassigned
ubuntu-advantage-tools (Ubuntu)
Triaged
Medium
Unassigned

Bug Description

I noticed a long time for Update Manager to "complete", that means, showing the available update list.

Profiling shows that the private function "get_apt_pkg_cache" from ubuntu-pro-client:/usr/lib/python3/dist-packages/uaclient/apt.py is called multiple times, summing up to 17 s delay.

--->
% python3 -m cProfile -s tottime ./update-manager
WARNING:root:can not import unity GI Namespace Dbusmenu not available
         9479342 function calls (9456814 primitive calls) in 35.130 seconds

   Ordered by: internal time

   ncalls tottime percall cumtime percall filename:lineno(function)
       48 17.232 0.359 18.049 0.376 apt.py:287(get_apt_pkg_cache)
        1 4.795 4.795 34.356 34.356 Gtk.py:1690(main)
        3 1.192 0.397 1.250 0.417 cache.py:203(open)
   417580 0.822 0.000 2.629 0.000 cache.py:308(__iter__)
        3 0.799 0.266 0.802 0.267 {built-in method time.sleep}
<---

Tags: noble
tags: added: noble
Revision history for this message
Renan Rodrigo (renanrodrigo) wrote :

Hello Nathan, thanks for reporting this.

I see there is plenty space for improvement in the cache calls. I can't estimate when, but at some point in time we need to rework the logic there.

Changed in ubuntu-advantage-tools (Ubuntu):
importance: Undecided → Medium
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.