This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


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

Re: bug in PrettyWriter


Felix S Klock II <pnkfelix@MIT.EDU> writes:

> > Some would say excessive and premature micro-optimization.
> 
> I'll say!

Well, it does make the generated bytecode both smaller and faster
(smaller is good even if it is not performance critical), and it
doesn't clutter up the source significantly.

> If this really is a performance critical loop,

I didn't say that ...  It is just a habit (idiosyncrasy) of mine,
in that I tend to write things as efficiently as I conveniently can.
Sometimes that habit may make my code be a little harder to read,
but that's just the way I am.

> perhaps you should
> preallocate a static char array of ' ' elements, and then use a call
> to System.arraycopy(..) [with multiple calls for large prefix arrays].
> That would be much faster than what you have here, at a pretty minimal
> cost in space, though the logic would be quite a bit hairier.

Well, that complicates the code *and* take up more memory (code and
data), so it is harder to justify.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/


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