Projects > cpp > Issues > Feature #2789

We are migrating issue tracker of Cocos2d-x Project to Github, please create new issue there. Thanks.

Create Issue on Github

Performance Test: containers

Feature #2789 [Closed]
ricardo 2013-09-10 18:20 . Updated almost 3 years ago

Add a container performance test in our suit of performance test:

We need to measure:

std::map vs std::unordered_map vs cocos2d::Dictionary

There are some comparisons here, but they are old and also we need our own tests.

What we need to test is:

  • performance of adding 5000 elements
  • performance of removing 5000 elements: Do not remove the elements in the order it were added. Remove them in random order. Reset the random seed before calling random. One way to do it is by populating the array of elements and then shuffle the array.
  • performance of fetching 5000 elements

  • memory it takes to add 5000 elements

Please, test it on an iPhone 4S and put the results in this spreadsheet: (add a new page for this)

ricardo 2013-09-10 18:29
  • Target version set to 3.0-alpha0
zhangxm 2013-09-11 02:32
  • Assignee set to dabingnn
zhangxm 2013-09-11 02:42

Any suggestion of measuring memory usage?

ricardo 2013-09-11 06:19

Minggo Zhang wrote:

Any suggestion of measuring memory usage?

For iOS, Profiler (that comes with Xcode) is a very good one.
In particular the “VM Tracker” module.\_User\_Reference/VMTrackerInstrument/VMTrackerInstrument.html

For Android, I don’t know.

zhangxm 2013-09-13 02:21

If we use profiler, then we can not get memory usage by codes? Just watch the profiling window?

ricardo 2013-09-13 05:12

Minggo Zhang wrote:

If we use profiler, then we can not get memory usage by codes? Just watch the profiling window?


Yes, to measure the memory you should use Instruments (or any other profiler), and see the results “manually”, on the Profiler window.

To measure the speed, you should use the built-in macro that I used for the “Alloc perf test”.

zhangxm 2013-09-13 05:43

Because cocos2d::Dictionary will invoke retain and release, so we should invoke these two methods when using std::map and std::unordered_map.

zhangxm 2013-09-16 13:03
  • Target version changed from 3.0-alpha0 to Candidate
zhangxm 2013-09-28 03:31
  • Target version changed from Candidate to 3.0-alpha1
zhangxm 2013-11-16 10:31
  • Assignee changed from dabingnn to dumganhar
  • Priority changed from Normal to High
  • Target version changed from 3.0-alpha1 to 3.0-beta
zhangxm 2013-12-30 10:04
  • Assignee changed from dumganhar to boyu0
zhangxm 2014-01-05 08:16
  • Target version changed from 3.0-beta to Candidate
zhangxm 2014-01-08 06:41
  • Target version changed from Candidate to 3.0-rc0
nite 2014-01-13 18:43
  • Parent task set to #3670
dumganhar 2014-01-21 08:38
  • Status changed from New to Closed
  • % Done changed from 0 to 100

Applied in changeset commit:e764f1f1850ef831c3e6313d901b0c74841a5f37.

zhangxm 2014-01-26 02:02
  • Description updated (diff)
  • Target version changed from 3.0-rc0 to 3.0-beta2
zhangxm 2014-01-26 02:09
  • Parent task deleted (#3670)

Atom PDF

Start date:2013-09-10
Due date:
% Done:


Target version:3.0-beta2

Sign up for our newsletter to keep up with the latest developments, releases and updates for Cocos2d-x.