git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] 3% tighter packs for free

From
Junio C Hamano <junkio@cox.net>
Date
Mar 18, 2006, 07:21 UTC
Message-ID
<7vwtesxloi.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0603172205490.4889@localhost.localdomain>
Nicolas Pitre <nico@cam.org> writes:
Show 9 quoted lines
>  			if (inscnt) {
> +				while (moff && ref_data[moff-1] == data[-1]) {
> +					if (msize == 0x10000)
> +						break;
> +					/* we can match one byte back */
> ...
> +					break;
> +				}
>  				out[outpos - inscnt - 1] = inscnt;

Once you make it into a patch form, it is plainly obvious that this is a good optimization. Since our BLK_SIZE is 16 bytes, you are grabbing up to 15 more bytes (on average 8 more bytes or so) for every match after a partially modified block.

Very nice. I wonder if a larger BLK_SIZE (say 32 bytes) would give us faster packing without losing much compression if we use this idea.

Previous: Nicolas PitreNext: Nicolas Pitre
Message 2 of 4 in “3% tighter packs for free”
  1. 3% tighter packs for freeNicolas Pitre, Mar 18, 2006
  2. Junio C HamanoMar 18, 2006
  3. Nicolas PitreMar 18, 2006
  4. Junio C HamanoMar 18, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.