This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] libstdc++/8761 and libstdc++/7076


On Fri, Jan 10, 2003 at 01:50:20AM -0500, Jerry Quinn wrote:
> This patch provides specializations for integer formatting within libstdc++.
> It nearly halves the time for the PR 8761 testcase from 21 seconds to 11
> seconds.  The PR 7076 testcase reduces from 7 seconds to 5.6 with this patch.

This is most excellent.

It seems to me we could get more improvement by eliminating the
format strings entirely, and working directly off the iosbase
members.  We could do even better by caching decisions when 
format flags are set, rather than looking them all up each time
operator<< is called.  Minimally, this might mean calling a
streamlined decimal-integer formatter when we know none of the
complications (hex etc.) is selected.

We should get a lot of improvement by eliminating memory allocations
from the main code path, and instead using local buffers, or a 
persistent buffer in the iosbase object.  (I seem to recall there 
were some malloc calls there, but haven't rechecked.)

Nathan Myers
ncm@cantrip.org


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]