Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Looking for a better design for drawing sprites in order.  (Read 6919 times)

0 Members and 1 Guest are viewing this topic.

alwayslearning

  • Newbie
  • *
  • Posts: 12
    • View Profile
Looking for a better design for drawing sprites in order.
« Reply #15 on: April 23, 2010, 09:06:40 pm »
Here are the results of multimap vs multiset (using same test case as above)

Here are the results so far (in ticks):
10,000 loops

10 sprites  
[map] average: 234
234
234
234

[set] average : 254
312
234
218

100 sprites
[map] average : 2755
2844
2734
2688

[set] average : 2668
2047
2500
3459

1000 sprites
[map] average : 34,568
34,813
34,297
34,594

[set] average : 32,291
32,390
32,375
32,109

10000
multimap) 388,969

multiset) 388,563


Its pretty damn close.

gsaurus

  • Sr. Member
  • ****
  • Posts: 262
    • View Profile
    • Evolution Engine
Looking for a better design for drawing sprites in order.
« Reply #16 on: April 23, 2010, 10:00:57 pm »
Quote from: "alwayslearning"
Its pretty damn close.

Yes, because they are internally implemented basically in the same way.
Pluma - Plug-in Management Framework

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
Looking for a better design for drawing sprites in order.
« Reply #17 on: April 23, 2010, 11:00:54 pm »
The reason why a programmer has to decide between std::multiset and std::multimap is never performance. It depends on him requiring separate keys and values or not.

It's not very meaningful to directly compare std::vector, std::set and std::map, either. These containers have quite different concepts.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development: