Performance Quiz #6 -- Looking at the fourth cut

Raymond is definately making some great headway.  Having targetted the single-character at a time conversion problem in version 4 of his program he's 1.84 times faster than the previous version.

Version Execution Time(seconds)
Unmanaged v1 1.328
Unmanaged v2 0.828
Unmanaged v3 0.343
Unmanaged v4 0.187

Unoptimized Managed port of v1      

0.124

As before I'm including the function costs in tree view, but only showing functions with an inclusive cost of at least 5% to keep the size of the report manageable.

Function Name (Sanitized)

 ExclusivePercent  InclusivePercent
  _mainCRTStartup 0.00 97.97
    _main 0.00 97.97
      Dictionary::Dictionary(void) 1.45 77.97
        MultiByteToWideChar 6.67 7.25
        std::vector<struct DictionaryEntry, ...>::insert(...) 0.29 14.20
          std::vector<struct DictionaryEntry, ...>::insert(...) 0.58 13.62
            std::vector<struct DictionaryEntry, ...>::_Ucopy(...) 0.00 6.67
              std::_Construct<struct DictionaryEntry,struct DictionaryEntry>(...) 0.29 6.67
                DictionaryEntry::DictionaryEntry(struct DictionaryEntry const &) 0.29 6.38
                  std::basic_string<...>::basic_string<...>(class std::basic_string<...> const &) 2.03 6.09
        std::basic_string<...>::basic_string<...>(unsigned short const *,...) 0.29 7.83
          std::basic_string<...>::assign(unsigned short const *,unsigned int) 0.00 7.54
        DictionaryEntry::Parse(class std::basic_string<….> const &) 1.16 33.33
          std::basic_string<...>::assign(...) 0.29 28.70
            std::basic_string<...>::_Grow(unsigned int,bool) 0.58 26.09
              std::basic_string<...>::_Copy(unsigned int) 1.16 25.22
                operator new(unsigned int) 0.58 24.06
                  … 0.29 23.19
                    … 2.61 22.90
                      AllocateHeap 4.06 21.45
      std::vector<struct DictionaryEntry,...>::~vector<...>(void) 0.00 18.84
        std::vector<struct DictionaryEntry,class std::allocator<….>::_Destroy(...) 0.00 18.84
          DictionaryEntry::~DictionaryEntry(void) 0.29 18.26
            std::basic_string<...>::~basic_string<...>(void) 0.58 17.68
              std::basic_string<...>::_Tidy(bool) 1.16 17.10
                _free 0.29 15.65
                  FreeHeap 4.35 15.36

So looking at this new program it seems like its time to start targetting string management and the allocations.  We're spending 24% of our time just allocating strings.  Now what's interesting is that at this point things are fast enough that the tear-down at the end is getting to be signficant -- at 18.84% it's a good chunk of the cost.