Monday, May 29, 2017

Re: OpenBSD Package Manager

On Mon, May 29, 2017 at 02:16:26PM -0400, H. Ishikawa wrote:
> Hello, I'd like to ask some specific areas of the pkg_add tools.
>
> 1. Why Perl instead of C?
> Perl is comparatively slow, and I think this limits who can contribute
> to the source code. How many developers in OpenBSD are actively doing
> any review of the pkg_add tools code? Would there be any interest in
> porting pkgsrc or pkgng from another BSD, or rewriting it in C?

I've done numerous presentations at various conferences explaining why perl.
The speed of the language has never been an issue. If anything, the initial
implementation of pkg_add in perl was *faster* than the previous tools in C.

> 2. Why no package database file?
> Other package managers like apt-get can fetch a single file that has
> all the package versions/info in it. When I update my packages on
> OpenBSD Current, it is a very slow process. Each package must be
> individually checked for updates, rather than comparing a list of
> what I have to a single list of the newest versions. This makes
> doing updates very painful and I avoid doing it sometimes.

That's because you're insisting on using https. We know that this is about
three times as slow, at least, than plain http, in that specific case.

> 3. Why so many connections?
> When I tried to investigate why the update was so slow, I saw that
> pkg_add was making one HTTPS connection per package! Tools like
> wget from Linux can reuse a single connection for many downloads.
> Could this be added to pkg_add in OpenBSD?

I'm sorry, but you don't know what you're talking about. wget would
not help you, because a lot of the downloads are partial downloads,
and getting partial downloads thru http is really complicated... the only
way to do partial downloads is to use Byte-Range.

During updates, partial downloads is a time-saver... a lot of huge
packages don't change that much, and pkg_add kills the connection as soon
as it has what it needs.

No comments:

Post a Comment