develooper Front page | perl.perl5.porters | Postings from March 2007

Optimizing by avoiding copies (was: Re: the utf8 flag)

Thread Previous | Thread Next
From:
Juerd Waalboer
Date:
March 30, 2007 15:14
Subject:
Optimizing by avoiding copies (was: Re: the utf8 flag)
Message ID:
20070330221412.GZ31277@c4.convolution.nl
Tels skribis 2007-03-31  0:03 (+0000):
> > Indeed, but this is an optimization. Optimization isn't part of teaching
> > how things work, it always comes after.
> I almost agree. :)
> Some decisions really need to be done early on, in the design phase. You
> cannot optimize when the design is broken.  E.g. if your data needs to
> be copied around *per design*, the best you can achive is O(N). When
> you do not have to copy the data, you suddenly can achive O(1). This
> distinctions is quite important, and not something you can fix
> aftwards apart from redesigning (aka let's break and re-assemble it :)

With Data::Alias you have a fair chance.

utf8::decode and utf8::encode provide similar opportunities to optimize
after the fact.

I don't see how decoding and encoding in-place or copying would be part
of your design, or greatly influence it.
-- 
korajn salutojn,

  juerd waalboer:  perl hacker  <juerd@juerd.nl>  <http://juerd.nl/sig>
  convolution:     ict solutions and consultancy <sales@convolution.nl>

Ik vertrouw stemcomputers niet.
Zie <http://www.wijvertrouwenstemcomputersniet.nl/>.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About