Julian Andres Klode: APT 1.1.8 to 1.1.10 going faster
Not only do I keep incrementing version numbers faster than ever before, APT also keeps getting faster. But not only that, it also has some bugs fixed and the cache is now checked with a hash when opening.
Important fix for 1.1.6 regression
Since APT 1.1.6, APT uses the configured xz compression level. Unfortunately, the default was set to 9, which requires 674 MiB of RAM, compared to the 94 MiB required at level 6.
This caused the test suite to fail on the Ubuntu autopkgtest servers, but I thought it was just some temporary hickup on their part, and so did not look into it for the 1.1.7, 1.1.8, and 1.1.9 releases. When the Ubuntu servers finally failed with 1.1.9 again (they only started building again on Monday it seems), I noticed something was wrong.
Enter git bisect. I created a script that compiles the APT source code and runs a test with ulimit for virtual and resident memory set to 512 (that worked in 1.1.5), and let it ran, and thus found out the reason mentioned above.
The solution: APT now defaults to level 6.
New Features
APT 1.1.8 introduces
Filed under: Debian, Ubuntu
/usr/lib/apt/apt-helper cat-file which can be used to read files compressed by any compressor understood by APT. It is used in the recent apt-file experimental release, and serves to prepare us for a future in which files on the disk might be compressed with a different compressor (such as LZ4 for Contents files, this will improve rred speed on them by factor 7).
David added a feature that enables servers to advertise that they do not want APT to download and use some Architecture: all contents when they include all in their list of architectures. This is to allow archives to drop Architecture: all packages from the architecture-specific content files, to avoid redundant data and (thus) improve the performance of apt-file.
Buffered writes
APT 1.1.9 introduces buffered writing for rred, reducing the runtime by about 50% on a slowish SSD, and maybe more on HDDs. The 1.1.9 release is a bit buggy and might mess up things when a write syscall is interrupted, this is fixed in 1.1.10.
Cache generation improvements
APT 1.1.9 and APT 1.1.10 improve the cache generation algorithms in several ways: Switching a lookup table from std::map to std::unordered_map, providing an inline isspace_ascii() function, and inlining the tolower_ascii() function which are tiny functions that are called a lot.
APT 1.1.10 also switches the cache s hash function to the DJB hash function and increases the default hash table sizes to the smallest prime larger than 15000, namely 15013. This reduces the average bucket size from 6.5 to 4.5. We might increase this further in the future.
Checksum for the cache, but no more syncs
Prior to APT 1.1.10 writing the cache was a multi-part process:
- Write the the cache to a temporary file with the dirty bit set to true
- Call
fsync()to sync the cache - Write a new header with the dirty bit set to false
- Call
fsync()to sync the new header - (Rename the temporary file to the target name)
std::string objects during the cache generation, accounting for about 10% of the run time. I m thinking of introducing a string_view class similar to the one proposed for C++17 and make use of that.
I also thought about calling posix_fadvise() before starting to parse files, but the cache generation process does not seem to spend a lot of its time in system calls (even with all caches dropped before the run), so I don t think this will improve things.
If anyone has some other suggestions or patches for performance stuff, let me know.Filed under: Debian, Ubuntu
24 Dec. 63
Dear Uncle Ron and Aunt Helen,
It has been quite awhile since I have written you folks. I am not too much of one for writing,
and when I do write, I keep putting it off, and putting it off; and the next thing you know,
the weeks turn into months and then the months into years.
I haven't sent any Christmas cards, so at this time I'll offer my best wishes for the season
to you.
It is Christmas Eve and I am working tonight. I will also work New Year's eve and day. It
really doesn't seem like Christmas here, and there isn't that much to do in the evening's;
So I'm just as well off working.
As I had mentioned, I had intended to send you some coins from Korea but I believe that I
put them in with a package that I had sent to Mom and told her to give them to you. In any
event, here are some in this box.
The Korean coin with the 10 on it is 10 Won, and worth about $.0769. The large copper coin
is Japanese ( 10 Yen) and about 2.8
Wait! I was wrong on the Korean coins.They are 10 Hwan which is the old money. When they
Changed to Won, they made 10 Hwan equal to 1 Won. (Sounds confusing and tongue-tying,
doesn't it?) So these 10 copper pieces with the 10 on them altogether are only worth 7 /
The Viet Namese coins with the former president Diem picture on them are soon being
taken out of circulation. ( Since he was overthrown and killed, they are going to
replace the money also.) The small pieces marked 1 dong are 1 piastre; also called one
Viet Namese dollar. 1 piastre is about .7 .
I also recall sending some coins home in my hold baggage. I'll tell Mom to look for
them and give them to you.
Now that I look back on it, the year I spent in Korea wasn't bad. It was difficult at
first having to work for an arrogant Jew boss, but after a few months I got out of his
office and was on my own working directly for the army people ( U.S.) The country of
Korea isn't too bad. As you can see on the coins they were in the year 4294 last year.
It is surprising for a civilization to be that far along in years and still live under
very primitive conditions. Going from Korea to Japan is like going from the dark ages
into the future science fiction world. Those people are really progressing in Japan.
I spent several days in Japan after I left Korea. Then I went to Honolulu for almost
a month. Then I went back to Japan for Leave for 3 weeks and then down here to Viet
Nam in October. They were building like crazy in Japan to get ready for the Olympics.
Working 4 hours a day, 7 days a week on construction. You could drive into Tokyo
early in the evening and return late in the night and find the road you had gone in
on was now completely torn away. And downtown Tokyo is vey nice. Lots of modern
building and just about any modern gadget you can think of.
I really like their cooking also. Their Kobe Beef is excellent. In this beef, the
cattle are pampered from the time they are born until they are slaughtered. They
massage them, feed them beer, and let them live a lazy life. I would really like
to work a year or two in Japan. The hot baths and big tubs are also great. Only
it is almost impossible to stand the hot temperatures that they can. Westerners
always have to add quite a lot of cold water before they can get in the tub.
The Viet Namese people are much dirtier than the Japanese or Koreans. They don't
have any hot baths here in Viet Nam. In fact, the majority of hotels ( built by
the French) don't even have hot water in them. The Korean houses don't look like
much from the outside, but inside they are spotlessly clean. The older Japanese
buildings look nic efrom the outside and are also clean inside.
I am here in the town of Nha Trang. It is a small town on the coast of the
China Sea. I like it here. My hotel is less than a hundred yards from the
beach. We are now in the winter season also, but it just got a little cooler
from having winds the past few weeks. This afternoon as we came to work there
were all sorts of people in swimming.
Lobster is also plentiful here and I eat quite a bit of it. Most of the
restaurant make a creamed corn soup with lots of chunks of crab meat in it.
This is very good.
Being out here in Nha Trang, we missed the coup d'etat. Things were quiet
here and the only way we knew what was happening was to listen to the radio
and talk to our co-workers of our radio system in Saigon. When they lifted
martial law and the curfew in Saigon, it took them several days later to
follow suit here.
There seems to be a noticed improvement since the coup. The people in
general seem much happier and there appears to be much more general activity
going on.
Well, I guess that's about it for now. I think I may have some Korean Won
notes back in my room and I'll check and enclose them if I can find them.
Say hello to Ira & family when you see them, and also to Aunt Marie if she
is still there with you.
'Bye for now
Your nephew
PS The Viet Namese coins with 50 XU on them are piastres.

Today I was wondering about converting a pdf made from scan of a book
into djvu, hopefully to reduce the size, without too much loss of
quality. My initial experiments with
initramfs-tools version 0.121~rc2 and dracut version 044+3-2 have
moved most of what was in their main binary packages into a 'core'
package (dracut-core, initramfs-tools-core), leaving only automation
hooks in the main package. The core packages can be coinstalled
without conflicts and without creating any initramfs images at
installation time.
If you're been wondering how they compare but were afraid to break
your system by overwriting your current working initramfs, now is
the time to try the other option.
Testing dracut, for initramfs-tools users


Yesterday we have released 
I don't often do retrospectives, but this year has been an
unusual one for me, as I moved to Finland almost six months ago.
The topic has come up in conversation a lot over the past few
months, so when people ask me what I think I can give some simple
answers without too much thought. Here's a brief summary.
There are some obvious changes:
Updated packages
apnum, appendix, archaeologie, babel, babel-french, babel-greek, babel-hungarian, bangorcsthesis, beamer-verona, bhcexam, bibarts, bidi, bxjscls, chemfig, commado, comprehensive, context, cslatex, csplain, ctanify, doclicense, dvips, ejpecp, exsheets, fbb, fibeamer, fithesis, fontools, francais-bst, gitinfo2, glossaries, gnuplottex, greek-fontenc, hyph-utf8, indextools, ksp-thesis, l3build, l3experimental, l3kernel, l3packages, latexcourse-rug, lollipop, lstbayes, lualibs, luaotfload, luatexja, luatexko, luatodonotes, make4ht, mcf2graph, media9, mex, mfirstuc, mhchem, mptopdf, nameauth, nevelok, newtx, nicetext, nucleardata, ocgx2, pageslts, petri-nets, phonrule, pkuthss, powerdot, proofread, proposal, pst-labo, pst-solides3d, reledmac, sapthesis, serbian-lig, showlabels, t2, tcolorbox, tempora, testhyphens, tetex, tex4ebook, tex4ht, texlive-scripts, texsis, thuthesis, toptesi, tudscr, ucharcat, versonotes, xcharter, xepersian, xifthen, xindy, xint.
New packages
beamertheme-detlevcm, beamertheme-metropolis, beamertheme-phnompenh, beamer-verona, bitpattern, carbohydrates, delimseasy, drawmatrix, einfuehrung2, ellipse, ffslides, gitlog, greektonoi, ksp-thesis, longfbox, options, simpler-wick, unicode-data.
Enjoy.
Performance for patching compressed files
Contents files are usually compressed with gzip, and kept compressed locally because they are about 500 MB uncompressed and only 30MB compressed. I profiled this, and it turns out there is not much we can do about it: The majority of the time is spent inside zlib, mostly combining CRC checksums:
Going forward, I think a reasonable option might be to recompress Contents files using lzo they will be a bit bigger (50MB instead of 30MB), but lzo is about 6 times as fast (compressing a 430MB Contents file took 1 second instead of 6).
(This is just a copy of 
Git is the clear winner now, with the migration rate increasing recently.
Packaging helpers
As usual, the number of packages using CDBS is quite stable. The number of packages using traditional debhelper might soon be lower than those using CDBS.
Patch systems and packaging formats





