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

Re: [PATCH] xdiff-interface.c (buffer_is_binary): Remove buffer size limitation

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Dec 4, 2007, 00:00 UTC
Message-ID
<alpine.LFD.0.9999.0712031559480.8458@woody.linux-foundation.org>
In-Reply-To
<20071203215007.GA14697@basalt.office.altlinux.org>
On Tue, 4 Dec 2007, Dmitry V. Levin wrote:
>
> Average file size in the linux-2.6.23.9 kernel tree is 10944 bytes,
Don't do "average" sizes. That's an almost totally meaningless number.

"Average" makes sense if you have some kind of gaussian distribution or similar. File sizes tend to be exponential distributions, and what makes much more sense is to look at the median. That doesn't show the effect of a few larger files, and also gives you a much better "half the files are smaller than x" idea.

And the median filesize for the kernel is just a few bytes over 4k.

Of the 23,000+ files in the current kernel, about 15,500 are less than 8kB. And 17,179 are smaller than the 10944 bytes you mention.

I'd argue that 8kB (or even 4kB) is probably a good number for things like that: it catches the bulk of all files in their entirety, but it *avoids* spending tons of time on the (few) really large files.

			Linus
Previous: Junio C HamanoNext: Johannes Schindelin
Message 5 of 7 in “xdiff-interface.c (buffer_is_binary): Remove buffer size limitation”
  1. xdiff-interface.c (buffer_is_binary): Remove buffer size limitationDmitry V. Levin, Dec 1, 2007
  2. Junio C HamanoDec 1, 2007
  3. Dmitry V. LevinDec 3, 2007
  4. Junio C HamanoDec 3, 2007
  5. Linus TorvaldsDec 4, 2007
  6. Johannes SchindelinDec 4, 2007
  7. David KastrupDec 5, 2007

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.