<feed xmlns='http://www.w3.org/2005/Atom'>
<title>squashfs-tools-ng.git/lib/util, branch v1.0.1</title>
<subtitle>A new set of tools and libraries for working with SquashFS images</subtitle>
<id>https://git.infraroot.at/squashfs-tools-ng.git/atom?h=v1.0.1</id>
<link rel='self' href='https://git.infraroot.at/squashfs-tools-ng.git/atom?h=v1.0.1'/>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/'/>
<updated>2020-06-09T04:51:31+00:00</updated>
<entry>
<title>Cleanup: mark sqfs_xattr_writer_flush writer argument as const</title>
<updated>2020-06-09T04:51:31+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2020-06-09T04:51:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=ec5ba7eb521626a85d2ab22e97eb1298b2ff6f55'/>
<id>urn:sha1:ec5ba7eb521626a85d2ab22e97eb1298b2ff6f55</id>
<content type='text'>
It does not make any changes to the writer itself, so mark it as
const. This also requires some similar changes to the string table.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>hash table: switch to sqfs_* types, mark functions as hidden</title>
<updated>2020-05-21T17:51:54+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2020-05-21T17:50:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=e942ed9b277cd8058e9ab1b5a762ee399f5231f0'/>
<id>urn:sha1:e942ed9b277cd8058e9ab1b5a762ee399f5231f0</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Cleanup: move hash table header to include directory</title>
<updated>2020-05-19T14:17:29+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2020-05-19T14:17:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=98b660135e142371431759c2a52a6ecb5457bb0d'/>
<id>urn:sha1:98b660135e142371431759c2a52a6ecb5457bb0d</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Enable uint128_t path</title>
<updated>2020-04-27T10:49:25+00:00</updated>
<author>
<name>Matt Turner</name>
<email>mattst88@gmail.com</email>
</author>
<published>2020-04-26T18:42:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=6a0d2f053ba32c63bb9a3c40135f8d5bb46c9cb0'/>
<id>urn:sha1:6a0d2f053ba32c63bb9a3c40135f8d5bb46c9cb0</id>
<content type='text'>
I forgot to enable this when I copied it over from Mesa. Mesa's
meson configuration system checks that a C program using the uint128_t
type compiles, but I think this is likely unnecessary. Simply check the
macro that clang and gcc define.

This cuts the .text size of hash_table.o by 160 bytes or about 4% on my
system.

Signed-off-by: Matt Turner &lt;mattst88@gmail.com&gt;
</content>
</entry>
<entry>
<title>Add hash table code to libutil.a</title>
<updated>2020-04-27T10:08:58+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2020-04-27T10:08:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=5630c5fa818a38c180ee4b859539cd37a9c2b93a'/>
<id>urn:sha1:5630c5fa818a38c180ee4b859539cd37a9c2b93a</id>
<content type='text'>
Not only does this build the hashtable into libutil.a, it also makes
sure the headers end up in the distribution tarball.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Import and use Mesa's hash table</title>
<updated>2020-04-22T12:48:46+00:00</updated>
<author>
<name>Matt Turner</name>
<email>mattst88@gmail.com</email>
</author>
<published>2020-04-19T23:01:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=20756f4354f333005bc59a2d07593d5d1429d287'/>
<id>urn:sha1:20756f4354f333005bc59a2d07593d5d1429d287</id>
<content type='text'>
With `perf record`/`perf report` I saw that 30% of the time was spent in
`sqfs_frag_table_find_tail_end` with tar2sqfs for a tarball containing
the Gentoo ebuild repository (many thousands of small files).

The reason was the bucketing hash table in frag_table.c: too many
elements in too few buckets meant lots of walking over the linked lists.

This patch replaces that hash table with the hash table implementation
from Mesa. Its implementation is more complex (is is an open-addressing,
linear-reprobing) hash table, but it is much better suited for the task.

On my 4c/8t Skylake, the time to run tar2sqfs drops from 7.5s to less
than 3s. CPU usage increases from ~207% to ~356%, presumably indicating
an increase in available parallelism due to the removal of the hash
table as a bottleneck. The `perf report` profile with this patch shows
that the time spent in `sqfs_frag_table_find_tail_end` has dropped from
~30% to 0.01%.

Output from ministat:

x before
+ after
    N          Min          Max       Median          Avg        Stddev
x  20        7.476        7.685       7.5725       7.5615   0.051254268
+  20         2.79        2.901        2.846      2.84475    0.03543842
Difference at 95.0% confidence
	-4.71675 +/- 0.0282015
	-62.3785% +/- 0.241477%
	(Student's t, pooled s = 0.0440618)

I imported only the bits of the hash table implementation that were
needed for frag_table.c. Among the changes I made after importing are

    - removed usage of ralloc, Mesa's recursive memory allocator
      - Replaced ralloc -&gt; malloc
		 ralloc_free -&gt; free
                 rzalloc_array -&gt; calloc
      - Removed mem_ctx parameters
      - Added free()s to the appropriate places (valgrind confirms there
	are no leaks)
    - removed _mesa_-prefix from function names

Fixes: #40
Signed-off-by: Matt Turner &lt;mattst88@gmail.com&gt;
</content>
</entry>
<entry>
<title>Restore workaround for unaligned reads in xxhash</title>
<updated>2020-03-18T12:33:47+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2020-03-18T12:23:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=0b5bcb0393df10ab671cfc76209b9b8b565323f1'/>
<id>urn:sha1:0b5bcb0393df10ab671cfc76209b9b8b565323f1</id>
<content type='text'>
The code was originally used inside the block processor, where 32 bit
aligned data could be guaranteed. If it is available in libutil, I
cannot possibly guarantee for alignment in future use elsewhere. Even
for the block processor it was rather risky "remember this detail very
well" buisness.

This commit restores the unaligned read treatment of the original.

Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Cleanup: Move xxhash32 code to libutil</title>
<updated>2020-03-18T12:33:47+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2020-03-18T12:19:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=7c29dc8db20a3e6f1fb351c44a068171bb6c1ff1'/>
<id>urn:sha1:7c29dc8db20a3e6f1fb351c44a068171bb6c1ff1</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Add a deep copy function for the str_table_t helper</title>
<updated>2020-03-03T23:28:39+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2020-03-03T23:28:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=6f47796dc0761fac359ec59ce26c7af5154e538d'/>
<id>urn:sha1:6f47796dc0761fac359ec59ce26c7af5154e538d</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
<entry>
<title>Add a very simple red-black tree implementation</title>
<updated>2020-02-22T00:20:58+00:00</updated>
<author>
<name>David Oberhollenzer</name>
<email>david.oberhollenzer@sigma-star.at</email>
</author>
<published>2020-02-22T00:09:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.infraroot.at/squashfs-tools-ng.git/commit/?id=0b1fce762dca88659b3103783e8852cb7265823e'/>
<id>urn:sha1:0b1fce762dca88659b3103783e8852cb7265823e</id>
<content type='text'>
Signed-off-by: David Oberhollenzer &lt;david.oberhollenzer@sigma-star.at&gt;
</content>
</entry>
</feed>
