[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2021-03-26 Thread Jarno Suni
Good, besides simple text file format is easy to parse and check by command line tools, if needed. To my surprise, I have more manually installed packages than automatically installed ones, so listing manually installed instead of automatically installed in the file would not give benefit.

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2021-03-23 Thread Julian Andres Klode
There is no performance issue with the file format, the parsing is not noticeable. There is a massive design problem in the DepCache having to visit every dependency in the cache and do marking stuff. This worked fine for tiny sets, but scales superlinear to package count. That's a very long

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2021-03-23 Thread Jarno Suni
Well, Boolean algebra may have had some influence on that. It is a common practice. 1 is shorter than yes. Oh that is sad, because I am not satisfied with the speed of apt-mark. On the other hand it is good. Another format or data structure may be more efficient. -- You received this bug

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2021-03-23 Thread Julian Andres Klode
It's also imaginable that we might change the value from e.g. 1 to yes. I don't know why it's an integer. In any case, I'd say you can't rely on that file at all. It might get changed in format, renamed or removed entirely without any notice. -- You received this bug notification because you are

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2021-03-23 Thread Jarno Suni
Oh, currently missing Auto-Installed field seems to mean the package is manually installed even if the Package field exists. I suppose I can rely on that in the future. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu.

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2021-03-23 Thread David Kalnischkies
No such version exists as it would be a bug. An Auto-Installed field != 1 is still possible if the section includes another field the current apt version doesn't know about and hence can't reason about. apt itself does not currently generate such stanzas, but a future version might. Or other

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2021-03-23 Thread Jarno Suni
Julian, BTW can you tell which version of apt was the latest where value of the Auto-Installed field can be something else than 1 in the file? -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1713219

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2021-03-23 Thread Julian Andres Klode
It's slow because it loads the entire depcache, and checks all dependencies. This can be avoided by refactoring the code, but it seems unnecessary. I'd rather add useful features like telling you which packages become autoremovable garbage after marking something, rather than refactoring the code

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2021-03-23 Thread Jarno Suni
Oh, actually I was already using set substraction in my code, but I was also checking for 'Auto-Installed: 0'. Maybe that is necessary with some older version of apt? (There was some bug in my code and that is why it did not work correctly for some packages.) Sorry for blaming and confusing.

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2021-03-22 Thread Jarno Suni
Well, the script in the description is a bit too simple. In my application, I was looking for 'Auto-Installed:' field with value 0 to find manually installed packages, and due to the change in the way the file is build nowadays I do not find them by the code anymore. Now the field is pointless. I

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2021-03-22 Thread David Kalnischkies
Mechanical train signals used to signal if the next section is clear vs. blocked by another train used to have the arm raised if it was clear and down if not. That was so that if the mechanic would fail in some way the arm would fall down and rest in the "blocked" state rather than in a "clear"

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2021-03-22 Thread Jarno Suni
I wonder why didn't you choose to have only manually installed packages in the file? It would be even smaller file. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1713219 Title: 'apt-mark showauto'

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2021-03-22 Thread Julian Andres Klode
Yes -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1713219 Title: 'apt-mark showauto' and 'apt show' is slow To manage notifications about this bug go to:

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2021-03-22 Thread Jarno Suni
So the file should only list packages that are installed automatically or what? -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1713219 Title: 'apt-mark showauto' and 'apt show' is slow To manage

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2021-03-22 Thread Julian Andres Klode
There is no bug there, this is all working correctly. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1713219 Title: 'apt-mark showauto' and 'apt show' is slow To manage notifications about this bug

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2021-03-22 Thread Jarno Suni
Maybe so, but the fact is that the file does not contain information about all packages installed to my system. (apt 2.0.4 (amd64) / Ubuntu 20.04) $ grep -c '^Package:' /var/lib/apt/extended_states 698 $ dpkg -l | grep ^ii | wc -l 1893 My file contains only records for packages that are

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2021-03-22 Thread Jarno Suni
Maybe I should make another bug report about it? -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1713219 Title: 'apt-mark showauto' and 'apt show' is slow To manage notifications about this bug go

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2021-03-22 Thread Julian Andres Klode
That's simply not true. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1713219 Title: 'apt-mark showauto' and 'apt show' is slow To manage notifications about this bug go to:

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2021-03-22 Thread Jarno Suni
I just found out information about packages installed from PPAs are not found in file configured in Dir::State::extended_states, so my script does not work for them. Are they found in some other file then? -- You received this bug notification because you are a member of Ubuntu Bugs, which is

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2020-05-28 Thread Julian Andres Klode
I'm not going to add a second independent reader to apt just so that apt-mark runs a bit faster. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1713219 Title: 'apt-mark showauto' and 'apt show' is

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2020-05-28 Thread Julian Andres Klode
The problem is that the code that reads the state reads it into the depcache. -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1713219 Title: 'apt-mark showauto' and 'apt show' is slow To manage

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2020-05-15 Thread Jarno Suni
Well, I think it is not a problem, if we do not need depcache here :) -- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1713219 Title: 'apt-mark showauto' and 'apt show' is slow To manage

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2017-09-09 Thread Julian Andres Klode
Two problems: (1) depcache opening is slow (2) we don't really need the depcache here. Anyway, triaged, but low importance. ** Changed in: apt (Ubuntu) Status: New => Triaged ** Changed in: apt (Ubuntu) Importance: Undecided => Low -- You received this bug notification because you

[Bug 1713219] Re: 'apt-mark showauto' and 'apt show' is slow

2017-08-26 Thread Jarno Suni
** Summary changed: - apt-mark showauto is slow + 'apt-mark showauto' and 'apt show' is slow ** Description changed: - $ time apt-mark showmanual >/dev/null + $ time apt-mark showauto >/dev/null - real 0m0.610s - user 0m0.544s - sys 0m0.024s + real 0m0.587s + user 0m0.552s + sys