strange compiler optimizations

"Quinn Tyler Jackson" <>
10 Aug 1998 10:05:52 -0400

          From comp.compilers

Related articles
strange compiler optimizations (Quinn Tyler Jackson) (1998-08-10)
Re: strange compiler optimizations (Matt Timmermans) (1998-08-13)
Re: strange compiler optimizations (Chris Clark USG) (1998-08-19)
| List of all articles for this month |

From: "Quinn Tyler Jackson" <>
Newsgroups: comp.compilers
Date: 10 Aug 1998 10:05:52 -0400
Organization: Compilers Central
Keywords: optimize, practice

I just compiled two version of some speed tests for LPM under Visual C++
5.0, and was shocked to get these results.

When I turned on OPTIMIZE FOR SPEED -- I got the following results:

        PLPM: 67
        LPM: 27

{That's how many milliseconds it took to find the target text at the end of
100kb of junk that included 10 purposely introduced near but false hits.
The pattern being looked for was fairly complex:

                        [*' '$
                        [+' '$
                        [*' '$
                        [*' '$
                        [*' '$

which finds any balanced tag pair of the form

        <a tag=value> some stuff </a>


Then I turned on OPTIMIZE FOR SIZE -- I got the following results:

        PLPM: 21
        LPM: 36

Why on earth did OPTIMIZE FOR SPEED do so poorly with PLPM and OPTIMIZE FOR
SIZE do so well, where it behaved as expected for LPM?

Quinn Tyler Jackson


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.