wxHashMap vs. std::map
Dave Bee
davebeeus at yahoo.com
Mon Sep 24 21:47:29 PDT 2007
Just realized why I still prefer using wxString over
std:string in wx based programs:
1. wxString is easier to work with when handling
unicode (the wxConv and other conversion funcs are
time savers)
2. std::string throws exceptions. wx doesn't. It's
hard to start getting used again to exceptions when
the majority of the code assumes there are no
exceptions.
Am I wrong? :)
Thanks,
Dave
--- Dave Bee <davebeeus at yahoo.com> wrote:
> --- Vadim Zeitlin <vadim at wxwidgets.org> wrote:
>
> > On Mon, 24 Sep 2007 15:13:23 -0700 (PDT) Dave Bee
> > <davebeeus at yahoo.com> wrote:
> >
> >
> > In fact as Michael wrote in a later reply, these
> > classes have different
> > performance characteristics in general. std::map
> is
> > an ordered container while hash map isn't.
>
> Oops. Sorry for missing Michael's reply (for some
> reason I didn't receive it in my email account). You
> (and Michael) are right, of course. I knew that
> std:map is implemented using a balanced tree, but I
> didn't know that wxHashMap isn't.
>
> I thought that if wxHashMap is capable of something
> like:
>
> h2["Bill"] = "ABC";
>
> (as illustrated in the wx manual), then it must be
> implemented just like std::map. Apparently I was
> wrong.
>
>
> > std::string in VC7 and 8 uses small
> > string optimization which wxString lacks so it
> could
> > be much more efficient for small strings.
>
> Thank your for this tip.
>
> >
> > Anyhow, if performance is really critical for
> you,
> > you should write your
> > own benchmarks (or use some existing ones) and
> look
> > at the results.
>
> Currently it is not critical. I was just curious and
> asked the question in case the answer is already
> known. I will certainly let you know when I perform
> such benchmarks.
>
> Thanks,
> Dave
>
>
>
>
>
____________________________________________________________________________________
> Moody friends. Drama queens. Your life? Nope! -
> their life, your story. Play Sims Stories at Yahoo!
> Games.
> http://sims.yahoo.com/
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> wx-users-unsubscribe at lists.wxwidgets.org
> For additional commands, e-mail:
> wx-users-help at lists.wxwidgets.org
>
>
____________________________________________________________________________________
Boardwalk for $500? In 2007? Ha! Play Monopoly Here and Now (it's updated for today's economy) at Yahoo! Games.
http://get.games.yahoo.com/proddesc?gamekey=monopolyherenow
More information about the wx-users
mailing list