What is "sigc::slot_base::empty() const" doing? #156

Open
opened 2017-02-19 06:57:28 +00:00 by pulsejet · 3 comments
pulsejet commented 2017-02-19 06:57:28 +00:00 (Migrated from github.com)

Trying to profile mkxp using gprof, I found that the call "sigc::slot_base::empty() const" had consumed a relatively huge CPU time. Any idea what this might be related to?

My output from gprof is here: https://drive.google.com/open?id=0Bxvz3wbxE2UXX0stZ0lJMFJsVVE

A visualization of the same here: https://drive.google.com/open?id=0Bxvz3wbxE2UXZ0JLOS1xQV9Uc0U
(gprof2dot, track the green boxes)

Trying to profile mkxp using gprof, I found that the call "sigc::slot_base::empty() const" had consumed a relatively huge CPU time. Any idea what this might be related to? My output from gprof is here: https://drive.google.com/open?id=0Bxvz3wbxE2UXX0stZ0lJMFJsVVE A visualization of the same here: https://drive.google.com/open?id=0Bxvz3wbxE2UXZ0JLOS1xQV9Uc0U (gprof2dot, track the green boxes)
Ancurio commented 2017-02-20 07:08:35 +00:00 (Migrated from github.com)

https://git.gnome.org/browse/libsigcplusplus/tree/sigc++/functors/slot_base.h#n329
https://git.gnome.org/browse/libsigcplusplus/tree/sigc++/functors/slot_base.h#n375
https://git.gnome.org/browse/libsigcplusplus/tree/sigc++/functors/slot_base.h#n131
https://git.gnome.org/browse/libsigcplusplus/tree/sigc++/functors/slot_base.h#n31

::empty() is roughly equivalent to

struct B {
  void *p;
};

struct A {
  B *b;
  bool empty() const {
    return (!b || !b->p);
  }
};

My best guess is that the amount of calls to this method + induced cache misses are responsible for your results. Would be interesting to know how many times this method is called during signal emission.
Are you having issues with performance?

Edit: Expressions in brackets are negated.

https://git.gnome.org/browse/libsigcplusplus/tree/sigc++/functors/slot_base.h#n329 https://git.gnome.org/browse/libsigcplusplus/tree/sigc++/functors/slot_base.h#n375 https://git.gnome.org/browse/libsigcplusplus/tree/sigc++/functors/slot_base.h#n131 https://git.gnome.org/browse/libsigcplusplus/tree/sigc++/functors/slot_base.h#n31 `::empty()` is roughly equivalent to ``` struct B { void *p; }; struct A { B *b; bool empty() const { return (!b || !b->p); } }; ``` My best guess is that the amount of calls to this method + induced cache misses are responsible for your results. Would be interesting to know how many times this method is called during signal emission. Are you having issues with performance? Edit: Expressions in brackets are negated.
pulsejet commented 2017-02-20 09:09:41 +00:00 (Migrated from github.com)

Er... how can I find out the number of calls (is this the 416852x)? (I'm a total noob to profiling, actually). I'm not having performance issues on x86, but there are some performance issues on android for some games, but since there is no sane way to profile native code on android, I decided to try to see if something obvious comes up while profiling for x86.

Er... how can I find out the number of calls (is this the 416852x)? (I'm a total noob to profiling, actually). I'm not having performance issues on x86, but there are some performance issues on android for some games, but since there is no sane way to profile native code on android, I decided to try to see if something obvious comes up while profiling for x86.
Ancurio commented 2017-02-20 11:19:05 +00:00 (Migrated from github.com)

Er... how can I find out the number of calls (is this the 416852x)?

I never used gprof before, but it does say "calls" in the column header, so that's what I'd suspect :)

I'm not having performance issues on x86, but there are some performance issues on android for some games

Have you looked into GPU profiling too? Many of the bottlenecks I saw 3 years ago were due to rendering. Although To the Moon lagged heavily and I don't believe that was due to GPU work..

> Er... how can I find out the number of calls (is this the 416852x)? I never used gprof before, but it does say "calls" in the column header, so that's what I'd suspect :) > I'm not having performance issues on x86, but there are some performance issues on android for some games Have you looked into GPU profiling too? Many of the bottlenecks I saw 3 years ago were due to rendering. Although To the Moon lagged heavily and I don't believe that was due to GPU work..
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: MapleShrine/mkxp#156
No description provided.