This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Regex instantiation
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Tim Shen <timshen91 at gmail dot com>
- Cc: Marc Glisse <marc dot glisse at inria dot fr>, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Thu, 9 Jan 2014 18:09:29 +0100
- Subject: Re: Regex instantiation
- Authentication-results: sourceware.org; auth=none
- References: <CAPrifDnbuYcMBSwZChRz7cE6ZfhPT55YRxJ8nLDHadMKe=L-hA at mail dot gmail dot com> <alpine dot DEB dot 2 dot 10 dot 1401090740190 dot 3666 at laptop-mg dot saclay dot inria dot fr> <CAPrifDmUaJayAucrHigb1231v6qdn=_mbzPpqWUTMi=z2_me=A at mail dot gmail dot com> <52CE762E dot 7050800 at oracle dot com> <CAPrifDnWoeuKcA1OVYZojvLYQqdAwr_6kyeAMvMJrb9xjg2ujQ at mail dot gmail dot com>
Hi,
> On 09/gen/2014, at 17:32, Tim Shen <timshen91@gmail.com> wrote:
>
>> On Thu, Jan 9, 2014 at 5:13 AM, Paolo Carlini <paolo.carlini@oracle.com> wrote:
>> We could maybe compute the length and dispatch to two different strategies?
>
> The length is at run-time, while the dispatch must be done at compile-time.
In any case, I don't think thousands of chars is a typical size. If everything is optimized performance-wise for, say, less than 100 chars, and gracefully degradates for bigger strings, I would think we are fine. But this kind of reasoning should be quantified, eg for 1000 things should not be much worse than now; see which sizes can be found in publically available testsuites.
> How can I calculate the binary file size cost of basic_string inst?
Build two .so, with and without and subtract the sizes? But maybe I don't get your question.
Paolo