From: erik quanstrom <quanstro@coraid.com>
To: 9fans@9fans.net
Subject: Re: [9fans] Strange rc bug for the 9fans bug-squashing squad
Date: Wed, 18 Mar 2009 10:16:45 -0400 [thread overview]
Message-ID: <25d85a355b053c18e5bbd7a982956ce1@coraid.com> (raw)
In-Reply-To: <df49a7370903180652p3de0f2c2m5069a396eaf0e028@mail.gmail.com>
On Wed Mar 18 09:54:54 EDT 2009, rogpeppe@gmail.com wrote:
> 2009/3/18 erik quanstrom <quanstro@quanstro.net>:
> > - ewd = wd+l+100-1;
>
> one small comment, based on a totally superficial scan of that diff:
> might it not be better to grow the buffer by some multiplicative
> factor, to avoid linear behaviour when reading large files?
> i often (for no particularly good reason) use 50% as a growth
> factor - it doesn't seem as radical as *2, but will still work ok
> in the long run.
i have two arguments against doing expontential growth:
- other dynamicly allocated buffers in rc are allocated
in increments of 100 bytes.
- the linear behavior would only be for long *tokens*.
the length of the input is irrelavant. only in the case
of tokens >= 100 chars would there be a second call
to realloc.
the total cost is O(maximum token length) for the
whole input. how could this be a problem?
- erik
next prev parent reply other threads:[~2009-03-18 14:16 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-16 23:26 Uriel
2009-03-17 1:31 ` Martin Neubauer
2009-03-17 2:01 ` Martin Neubauer
2009-03-17 22:27 ` Uriel
2009-03-17 22:43 ` erik quanstrom
2009-03-17 23:23 ` Uriel
2009-03-17 23:26 ` erik quanstrom
2009-03-18 0:26 ` Uriel
2009-03-18 1:23 ` Russ Cox
2009-03-18 7:31 ` Gabriel Díaz López de la Llave
2009-03-18 10:31 ` maht
2009-03-18 15:27 ` erik quanstrom
2009-03-18 1:25 ` erik quanstrom
2009-03-18 11:30 ` Uriel
2009-03-18 10:53 ` roger peppe
2009-03-18 13:18 ` erik quanstrom
2009-03-18 13:52 ` roger peppe
2009-03-18 14:16 ` erik quanstrom [this message]
2009-03-18 14:36 ` roger peppe
2009-03-17 0:40 geoff
2009-03-17 22:16 ` Uriel
2009-03-17 22:24 ` erik quanstrom
2009-03-17 23:14 ` Uriel
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=25d85a355b053c18e5bbd7a982956ce1@coraid.com \
--to=quanstro@coraid.com \
--cc=9fans@9fans.net \
/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).