ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Alexey Tourbin <at@altlinux.ru>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: Re: [devel] rpm: rsyncable deflate vs LZMA
Date: Sat, 31 May 2008 01:31:09 +0400
Message-ID: <20080530213109.GV7996@solemn.turbinal> (raw)
In-Reply-To: <20080529232331.GS7996@solemn.turbinal>

[-- Attachment #1: Type: text/plain, Size: 3042 bytes --]

On Fri, May 30, 2008 at 03:23:31AM +0400, Alexey Tourbin wrote:
> On Fri, May 30, 2008 at 01:56:10AM +0400, Dmitry V. Levin wrote:
> > On Fri, May 30, 2008 at 01:31:14AM +0400, Alexey Tourbin wrote:
> > [...]
> > > У меня есть идея.  Для выбора точек синхронизации (gzflush) можно
> > > использовать не только "слепой" rsync hint, но и cpio hint -- как
> > > только мы видим cpio magic "070707", мы знаем, что через несколько
> > > байтов будет mtime и потом пойдёт имя и содержимое файла.  То есть
> > > sync можно делать в месте окончания очередного cpio header.
> > 
> > Это заметно снизит степень сжатия, когда в архиве много маленьких файлов?
> 
> Этим можно управлять, чтобы сознательно пропускать только "совсем
> маленькие" файлы.
> 
> > > Правда, я не знаю, даст это что-нибудь в случае с маленькими файлами
> > > или нет.  Это может ничего не дать из-за того, что первые совпавшие
> > > блоки в сжатом виде всё равно могут отличаться (из-за backreferences
> > > в предыдущий блок).
> > 
> > Могут или будут?
> 
> Если сделать как показано ниже, то для пакета man-pages (после повторной
> пересборки) 'speedup 1.09' возрастает до 'speedup 1.19'.  То есть эффект
> от синхронизации сразу после cpio хедера есть, он заметный, но не
> настолько большой, чтобы всё искупать.

Я реализовал более аккуратный cpio хинтинг для rsyncable_gzwrite().

Также появились первые результаты rsyncability тестирования.
А именно, мы тестируем rsyncability двух rpm пакетов, как если
бы они были собраны уже с помощью rsyncable_gzwrite().

test-rsynability glibc-core-2.5.1-alt4.x86_64.rpm glibc-core-2.5.1-alt5.x86_64.rpm => "speedup is 15.99"
test-rsynability glibc-core-2.3.5-alt7.x86_64.rpm glibc-core-2.5.1-alt5.x86_64.rpm => "speedup is 1.00"
test-rsynability glibc-2.3.5-alt7.x86_64.rpm glibc-2.5.1-alt5.x86_64.rpm => "speedup is 1.28"
test-rsynability firefox-2.0.0.13-alt1.x86_64.rpm firefox-2.0.0.14-alt1.x86_64.rpm => "speedup is 1.97"
test-rsynability xorg-x11-server-1.4.0.90-alt17.x86_64.rpm xorg-x11-server-1.4.0.90-alt19.x86_64.rpm => "speedup is 1.48"

Например, "speedup is 1.97" для пакета firefox означает, что примерно
половина кусков между этими двумя пакетами совпадают (если бы эти пакеты
были собраны с rsyncable_gzwrite), а другая половина кусков не совпадает;
так что по размеру придётся скачивать примерно половину фаерфокса.

Вот код для тестирования.

gzdio.c:
#include <stdio.h>
#include <assert.h>
#include <rpmio.h>
int main()
{
	FD_t Fd = Fdopen(fdDup(fileno(stdout)), "w9.gzdio");
	assert(Fd);
	char buf[BUFSIZ];
	size_t n, m;
	while ((n = fread(buf, 1, sizeof(buf), stdin))) {
		m = Fwrite(buf, 1, n, Fd);
		assert(m == n);
	}
	Fclose(Fd);
	return 0;
}

(gzdio.c надо линковать с новым librpmio, в котором сидит
rsyncable_gzwrite).

test-rsynability:
#!/bin/sh -efu
f1="$1" f2="$2"
shift 2
rpm2cpio "$f1" |./gzdio >cpio1.gz
rpm2cpio "$f2" |./gzdio >cpio2.gz
rsync -v -e ./rsync-shell foo:cpio1.gz cpio2.gz

rsync-shell:
shift && exec "$@"

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2008-05-30 21:31 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-29 12:38 Alexey Tourbin
2008-05-29 13:28 ` Alexander Bokovoy
2008-05-29 16:50   ` Alexey Tourbin
2008-05-29 18:37   ` Dmitry V. Levin
2008-05-29 19:50     ` Alexey Tourbin
2008-05-29 20:13       ` Alexey Tourbin
2008-05-29 20:28         ` Led
2008-05-29 20:42           ` Alexey Tourbin
2008-05-29 20:16       ` Alexander Bokovoy
2008-05-29 21:31     ` Alexey Tourbin
2008-05-29 21:56       ` Dmitry V. Levin
2008-05-29 23:23         ` Alexey Tourbin
2008-05-30 21:31           ` Alexey Tourbin [this message]
2008-05-31 10:09             ` [devel] rsyncability test: openoffice Alexey Tourbin
2008-05-30  9:27         ` [devel] rpm: rsyncable deflate vs LZMA Alexey Tourbin
2008-05-30  8:21 ` Anton V. Boyarshinov
2008-05-30 11:28   ` Alexey Tourbin
2008-05-30 10:44     ` Anton Farygin
2008-05-30 12:07       ` Alexander Bokovoy
2008-05-30 15:03         ` Anton V. Boyarshinov
2008-05-30 15:09           ` Dmitry V. Levin
2008-05-30 15:17             ` Anton V. Boyarshinov
2008-05-30 15:25               ` Mikhail Gusarov
2008-05-30 15:32                 ` Anton V. Boyarshinov
2008-05-30 15:37                   ` Mikhail Gusarov
2008-06-01 12:06         ` Anton Farygin
2008-05-31 10:25       ` Alexey Tourbin
2008-05-31 16:59         ` Kirill A. Shutemov
2008-06-01  0:33           ` Alexey Tourbin
2008-06-01 13:07             ` Mikhail Gusarov
2008-06-01 18:08               ` [devel] [JT] fortunezilla :) Michael Shigorin
2008-06-02  1:44                 ` Sergey Balbeko
2008-06-02  5:06                   ` Mikhail Gusarov
2008-06-02  7:54                     ` Alexey I. Froloff
2008-06-02  8:21                   ` Michael Shigorin
2008-06-01 19:05               ` [devel] rpm: rsyncable deflate vs LZMA Alexey I. Froloff
2008-05-30 11:47     ` Anton V. Boyarshinov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080530213109.GV7996@solemn.turbinal \
    --to=at@altlinux.ru \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git