Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #26083
| From | Lew <noone@lewscanon.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: replace extended characters |
| Date | 2011-02-10 21:29 -0500 |
| Organization | albasani.net |
| Message-ID | <ij26s6$ts3$1@news.albasani.net> (permalink) |
| References | <15bd3363-c781-487b-98d5-2243eff7cc8f@24g2000yqa.googlegroups.com> <ij1uhu$80n$2@lust.ihug.co.nz> <pg05p.441$Y63.22@newsfe02.iad> |
Arved Sandstrom wrote: > That's actually not true. When you're designing your solution - which is the > point that the OP is at - you should most definitely be considering > efficiency. More often than not you cannot make an inefficient solution > efficient without changing it fairly radically, so why not design it properly > first? > > It's much more correct to say, get an efficient maintainable solution working > correctly first, then do your last little tweaks if necessary. The OP correctly seeks to consider algorithms prior to delving into implementation. Arved wisely shows how correctness and algorithmic efficiency can share precedence. Joshua reminds us that problem scale affects performance analysis and design. Optimizations discussed here so far have avoided descent into micro-optimization, and we have heard a helpful caution against such error. The OP's goal lets us clarify the difference. Synthesizing the advice of our gurus, the OP now knows that a couple of algorithms - character-at-a-time and block-oriented - will work, and at what problem scales they're likely to help. (Predictions prior to measurement are always at best hypothetical, but you have to assess likelihood while planning.) Signposts guard the fringes - avoid multi-char code points and large character sets. Those are the optimizations and the correctness. Performance analysis is algorithmic and doesn't seem premature. Micro-optimization would be to start in right away with custom char arrays and manual buffering through idiosyncratic I/O streams. Whatever the standard API may lack, it at least provides decent infrastructure for that sort of thing. So initial implementation will leave that stuff bog standard, and I'll bet dollars to doughnuts that in the OP's scenario that'll do. Changing that layer from get-go would be tweaking and constitutes premature optimization, a.k.a. micro-optimization. -- Lew Ceci n'est pas une fenêtre. .___________. |###] | [###| |##/ | *\##| |#/ * | \#| |#----|----#| || | * || |o * | o| |_____|_____| |===========|
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
replace extended characters VIDEO MAN <bigmush7@googlemail.com> - 2011-02-10 15:33 -0800
Re: replace extended characters RedGrittyBrick <RedGrittyBrick@spamweary.invalid> - 2011-02-11 15:31 +0000
Re: replace extended characters Arved Sandstrom <asandstrom3minus1@eastlink.ca> - 2011-02-10 21:27 -0400
Re: replace extended characters Arne Vajhøj <arne@vajhoej.dk> - 2011-02-10 21:42 -0500
Re: replace extended characters Lawrence D'Oliveiro <ldo@geek-central.gen.new_zealand> - 2011-02-11 15:35 +1300
Re: replace extended characters Lew <noone@lewscanon.com> - 2011-02-10 21:29 -0500
Re: replace extended characters Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-02-11 18:40 -0500
Re: replace extended characters Roedy Green <see_website@mindprod.com.invalid> - 2011-02-11 16:57 -0800
Re: replace extended characters v_borchert@despammed.com (Volker Borchert) - 2011-02-12 05:58 +0000
Re: replace extended characters Arne Vajhøj <arne@vajhoej.dk> - 2011-02-10 21:52 -0500
Re: replace extended characters Joshua Cranmer <Pidgeot18@verizon.invalid> - 2011-02-10 19:37 -0500
Re: replace extended characters Lew <noone@lewscanon.com> - 2011-02-10 19:18 -0500
Re: replace extended characters Roedy Green <see_website@mindprod.com.invalid> - 2011-02-11 16:55 -0800
Re: replace extended characters Owen Jacobson <angrybaldguy@gmail.com> - 2011-02-11 22:15 -0500
Re: replace extended characters Roedy Green <see_website@mindprod.com.invalid> - 2011-02-11 15:07 -0800
Re: replace extended characters Roedy Green <see_website@mindprod.com.invalid> - 2011-02-11 15:11 -0800
csiph-web