Avoid a function call for most status updates
commit19af88faa954cac202bcdbbe3b2f7e3c0675699d
authorJonathan Nieder <jrnieder@gmail.com>
Fri, 11 Jun 2010 14:36:21 +0000 (11 14:36 +0000)
committerJonathan Nieder <jrnieder@gmail.com>
Fri, 11 Jun 2010 14:36:21 +0000 (11 14:36 +0000)
treeb88f298b7d6e060c6898c38bde1185d7d22a238a
parentc0ae998df25e06082414464e3a34d5ec009ebcd5
Avoid a function call for most status updates

Let progress reporting backends can choose an appropriate resolution
for progress updates in the set_denominator() function, and use an
inline function to avoid any work except when n is a multiple of
the appropriate increment.  This significantly speeds up
RebuildAffixesStemsAndSignaturesFromWordSplits.

Before:

  ReadCorpus:: Time elapsed: 2825ms
  Find Suffixes: Time elapsed: 15889ms

After:

  ReadCorpus:: Time elapsed: 2766ms
  Find Suffixes: Time elapsed: 13441ms

(Timings are best of three runs, analyzing the 14-million-word
English-language example corpus.)

git-svn-id: svn+ssh://clownfish.uchicago.edu/Volumes/Behemoth/svn/linguistica/Trunk@2046 94adc35a-e818-0410-82ae-8e236d748f55
gui/Status.cpp
gui/Status.h
include/ui/Status.h
ui/Status.cpp