Subject: Re: suggestion: slight optimization for UT_String
From: Joaquín Cuenca Abela (firstname.lastname@example.org)
Date: Mon Mar 19 2001 - 14:56:39 CST
Vlad Harchev wrote:
> On 19 Mar 2001, Joaquin Cuenca Abela wrote:
> > On 19 Mar 2001 14:04:57 +0400, Vlad Harchev wrote:
> > >
> > > Then the following could be used to multiply 'x' by 1.5:
> > > (x + x<<1) >> 1
> > >
> > > I will be very fast.
> Hmm, that would be better written as
> x + x>>1
> That will definitely be faster than x*1.5
> > uhm, it's not so readable as x = x * 1.5. In addition, if later we
> > decide to change from 1.5 to something else, it becomes harder. And in
> We may decide not to change it simply..
:-) Of course, it doesn't work. We're taking the best number based in
what we know right now (ie. absolutely nothing, so we are taking what's
"usually" the best growing function, and what's "usually" the best
growing factor). If 1 year later somebody does somes figures, and find
that it can slightly tune up abiword setting a growing factor of 1.8, it
should be capable of change the growing factor in an easy way.
Motto: never suppose that your will not change. Only unuseful (or
perfect :) code never changes.
-- Joaquín Cuenca Abela email@example.com
This archive was generated by hypermail 2b25 : Mon Mar 19 2001 - 14:56:51 CST