Re: On Tabs and Spaces
- From
Michael Witten <mfwitten@mit.edu>
- Date
- Oct 17, 2007, 11:23 UTC
- Message-ID
- <6A484AE6-ECCD-4473-BEF8-3451EBF8FAFF@mit.edu>
- In-Reply-To
- <dbfc82860710170321l458ebd1cr6bf619cef9bb7300@mail.gmail.com>
On 17 Oct 2007, at 6:21:30 AM, Nikolai Weibull wrote:
> According to this calculation the waste is 47808782 bytes, or about > 45.6 MiB, for 8-spaces-wide tabs.
I concede my calculation was crude.
Interestingly, modifying my calculation to look for tabs at the beginning of the line gives a similar result:
# calculates the extra space required to
# use the given number of spaces/tab.
size()
{
count=`grep -RIo "^\`printf \"\t\"\`" . | wc -l`;
perl -e "print $count*$(($1-1))/1024/1024 . \" MiB\n\"";
}size 8; => 49.7416791915894 MiB
and for git:
size 8; => 1.25082969665527 MiBAnyway, thanks for the neat script.
mfwitten