Unexpected performance results

Discussion in 'C++' started by Dave, Apr 8, 2004.

  1. Dave

    Dave Guest

    Hello all,

    Can anybody think of a plausible explanation for why my profiler is telling
    me that I get better performance with map::eek:perator[] than with
    map::insert()?

    Thanks,
    Dave
     
    Dave, Apr 8, 2004
    #1
    1. Advertising

  2. Dave

    Leor Zolman Guest

    On Thu, 8 Apr 2004 11:24:24 -0700, "Dave" <> wrote:

    >Hello all,
    >
    >Can anybody think of a plausible explanation for why my profiler is telling
    >me that I get better performance with map::eek:perator[] than with
    >map::insert()?


    This would be totally a QOI issue, but I did take a look just for grins in
    an implementation or two, and I noticed that, even though operator[] tends
    to call insert() to do its work, insert() returns a pair<...> by value
    while operator[] just returns a ref to an element. Perhaps the construction
    of that return value from insert() might be your culprit...
    -leor
    >
    >Thanks,
    >Dave
    >


    --
    Leor Zolman --- BD Software --- www.bdsoft.com
    On-Site Training in C/C++, Java, Perl and Unix
    C++ users: Download BD Software's free STL Error Message Decryptor at:
    www.bdsoft.com/tools/stlfilt.html
     
    Leor Zolman, Apr 8, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Scott Lander

    Re: unexpected results

    Scott Lander, Jul 7, 2003, in forum: Perl
    Replies:
    0
    Views:
    1,744
    Scott Lander
    Jul 7, 2003
  2. =?Utf-8?B?QXJ0?=

    Page inherting from .master - unexpected results

    =?Utf-8?B?QXJ0?=, May 26, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    364
    =?Utf-8?B?QXJ0?=
    May 26, 2006
  3. CK
    Replies:
    3
    Views:
    332
  4. Steven D'Aprano

    Unexpected timing results

    Steven D'Aprano, Feb 23, 2006, in forum: Python
    Replies:
    7
    Views:
    401
    Steven D'Aprano
    Feb 24, 2006
  5. Sean
    Replies:
    10
    Views:
    640
    Keith Thompson
    Aug 26, 2004
Loading...

Share This Page