git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcus Griep <marcus@griep.us>
To: Junio C Hamano <gitster@pobox.com>
Cc: Petr Baudis <pasky@suse.cz>, Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH v2 2/3] strbuf: Add method to convert byte-size to human readable form
Date: Thu, 14 Aug 2008 20:53:59 -0400	[thread overview]
Message-ID: <48A4D3A7.6080109@griep.us> (raw)
In-Reply-To: <7viqu3ci5k.fsf@gitster.siamese.dyndns.org>

Junio C Hamano wrote:
> 	960 bps
>         0.9 KiB/s
> 	2.3 MiB/s

A pedantic note, but bps is bits per second, whereas Bps or B/s is bytes
per second.  Requiring the same suffix for each would prevent some easily
overlooked issues like this.

> I also am not particularly happy about using "double" in this API.  Most
> of the callers that gather stats in the rest of the codebase count in
> (long) integers as far as I can tell, and it may be conceptually cleaner
> to keep the use of double as an internal implementation issue of this
> particular function.

The function requires the use of a double for fractional parts, so letting 
the compiler perform an upcast were necessary seems innocuous to me.

Also, Yibi-/Zibi-, unlikely to be used as they are, won't fit in a long.

-- 
Marcus Griep
GPG Key ID: 0x5E968152
——
http://www.boohaunt.net
את.ψο´

  parent reply	other threads:[~2008-08-15  0:55 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-14 22:18 [PATCH v2 0/3] count-objects size and strbuf human-readable Marcus Griep
2008-08-14 22:18 ` [PATCH v2 1/3] count-objects: Add total pack size to verbose output Marcus Griep
2008-08-14 22:18   ` [PATCH v2 2/3] strbuf: Add method to convert byte-size to human readable form Marcus Griep
2008-08-14 22:18     ` [PATCH v2 3/3] count-objects: add human-readable size option Marcus Griep
2008-08-14 22:37       ` Petr Baudis
2008-08-14 23:52         ` Marcus Griep
2008-08-15  0:10           ` Junio C Hamano
2008-08-14 22:34     ` [PATCH v2 2/3] strbuf: Add method to convert byte-size to human readable form Petr Baudis
2008-08-14 23:04       ` Junio C Hamano
2008-08-14 23:24         ` Petr Baudis
2008-08-14 23:40           ` Junio C Hamano
2008-08-15  0:53         ` Marcus Griep [this message]
2008-08-15  0:46       ` Marcus Griep
2008-08-15  0:52         ` Shawn O. Pearce
2008-08-15  4:20 ` [PATCH v3 1/3] count-objects: Add total pack size to verbose output Marcus Griep
2008-08-15  4:20   ` [PATCH v3 2/3] strbuf: Add method to convert byte-size to human readable form Marcus Griep
2008-08-15  4:20     ` [PATCH v3 3/3] count-objects: add human-readable size option Marcus Griep
2008-08-15 15:47   ` [PATCH v3.1 1/3] count-objects: Add total pack size to verbose output Marcus Griep

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=48A4D3A7.6080109@griep.us \
    --to=marcus@griep.us \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pasky@suse.cz \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).