From: Peter Olcott on 2 Jun 2010 11:52 On 6/1/2010 1:04 PM, Joseph M. Newcomer wrote: > See below... > On Tue, 01 Jun 2010 10:34:40 -0500, Peter Olcott<NoSpam(a)OCR4Screen.com> wrote: > >> If you measure my code against the incorrect standard that it is >> specifically encoded to be the fastest possible encoding, even then it >> is not abysmal. All of the performance improvements that you suggested >> don't result in as much as a doubling in speed. >> http://www.ocr4screen.com/UTF8.cpp >> >> From benchmarking my code against the code that Hector posted a link to >> http://bjoern.hoehrmann.de:80/utf-8/decoder/dfa/ >> This other code was only 37% faster. > ***** > "Only" 37% faster? Actually 37% is a pretty big number in terms of performance! Most > attempts to "improve" performance are lucky if they get single-digit percentage > improvement. As someone who spent a nontrivial amount of his life worrying about these > issues, I can say that 37% is a SUBSTANTIAL performance improvement! > > And if it were 1% faster, it would still prove your code was not the fastest possible. But > 37%? You aren't even in the running in this contest! > joe I did a better job of benchmarking and I made changes that slowed my code down, removing the gotos and using a std::vector<uint8_t> instead of NUL the terminated uint8_t*. His code is now 267% faster than mine. The benchmark timed how long it took to decode 100 instances of the entire Unicode set encoded as UTF-8.
From: Oliver Regenfelder on 2 Jun 2010 12:22 Hello, Christian Hackl wrote: >> This is not even a general C++ newsgroup but an MFC one. > > The message was cross-posted to comp.lang.c++ and microsoft.public.vc.mfc. Sorry, I didn't see the crosspost in the header, and he didn't mention it in his post. Best regards, Oliver
From: Pete Delgado on 2 Jun 2010 15:57 "Peter Olcott" <NoSpam(a)OCR4Screen.com> wrote in message news:qbednWXw38bMkJjRnZ2dnUVZ_jidnZ2d(a)giganews.com... > > Since no one else here thinks that my code is anything like abysmal that > shows that there is something else going on besides an objective > assessment of the quality of my code. I think that it would be a mistake on your part to assume that the quality of your code is not suspect just because you have not gotten an abundance of posts stating that fact. You have already demonstrated an extraordinary lack of receptiveness to constructive criticism, so why would any of us continue to beat our heads against the wall? -Pete
From: Peter Olcott on 2 Jun 2010 17:31 On 6/2/2010 2:57 PM, Pete Delgado wrote: > "Peter Olcott"<NoSpam(a)OCR4Screen.com> wrote in message > news:qbednWXw38bMkJjRnZ2dnUVZ_jidnZ2d(a)giganews.com... >> >> Since no one else here thinks that my code is anything like abysmal that >> shows that there is something else going on besides an objective >> assessment of the quality of my code. > > I think that it would be a mistake on your part to assume that the quality > of your code is not suspect just because you have not gotten an abundance of > posts stating that fact. You have already demonstrated an extraordinary lack > of receptiveness to constructive criticism, so why would any of us continue > to beat our heads against the wall? > > -Pete > > After correcting three typos it worked correctly the first time. This is the most objective measure of quality.
From: Joseph M. Newcomer on 2 Jun 2010 17:40
See below... On Wed, 02 Jun 2010 10:52:28 -0500, Peter Olcott <NoSpam(a)OCR4Screen.com> wrote: >On 6/1/2010 1:04 PM, Joseph M. Newcomer wrote: >> See below... >> On Tue, 01 Jun 2010 10:34:40 -0500, Peter Olcott<NoSpam(a)OCR4Screen.com> wrote: >> >>> If you measure my code against the incorrect standard that it is >>> specifically encoded to be the fastest possible encoding, even then it >>> is not abysmal. All of the performance improvements that you suggested >>> don't result in as much as a doubling in speed. >>> http://www.ocr4screen.com/UTF8.cpp >>> >>> From benchmarking my code against the code that Hector posted a link to >>> http://bjoern.hoehrmann.de:80/utf-8/decoder/dfa/ >>> This other code was only 37% faster. >> ***** >> "Only" 37% faster? Actually 37% is a pretty big number in terms of performance! Most >> attempts to "improve" performance are lucky if they get single-digit percentage >> improvement. As someone who spent a nontrivial amount of his life worrying about these >> issues, I can say that 37% is a SUBSTANTIAL performance improvement! >> >> And if it were 1% faster, it would still prove your code was not the fastest possible. But >> 37%? You aren't even in the running in this contest! >> joe > >I did a better job of benchmarking and I made changes that slowed my >code down, removing the gotos and using a std::vector<uint8_t> instead >of NUL the terminated uint8_t*. His code is now 267% faster than mine. **** Code that is faster by a factor of 3 means your code is not even worth looking at. Nobody will care whether it is correct or not, if it is nearly 3 times slower than an alternative. We would sweat blood to get 10% improvement. So if you are not competitive with some other code by a factor of 3, don't even waste your time. Use the other code. joe **** > >The benchmark timed how long it took to decode 100 instances of the >entire Unicode set encoded as UTF-8. Joseph M. Newcomer [MVP] email: newcomer(a)flounder.com Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm |