Merge lp:~3v1n0/nux/callgrind-improvements into lp:nux
Proposed by
Marco Trevisan (Treviño)
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Brandon Schaefer | ||||
Approved revision: | 778 | ||||
Merged at revision: | 773 | ||||
Proposed branch: | lp:~3v1n0/nux/callgrind-improvements | ||||
Merge into: | lp:nux | ||||
Prerequisite: | lp:~3v1n0/nux/rect-c++11 | ||||
Diff against target: |
67 lines (+12/-7) 4 files modified
Nux/WindowThread.cpp (+4/-5) Nux/WindowThread.h (+1/-1) configure.ac (+1/-1) debian/changelog (+6/-0) |
||||
To merge this branch: | bzr merge lp:~3v1n0/nux/callgrind-improvements | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot (community) | continuous-integration | Approve | |
Andrea Azzarone (community) | Approve | ||
Michi Henning (community) | Approve | ||
Review via email: mp+158233@code.launchpad.net |
Commit message
WindowThread: return a const& in GetDrawList
This will reduces a lot the copies that unity has to do in very-often called functions
Description of the change
Returning a const& we have practically no cost when running this in unity, see this pre/after comparison:
To post a comment you must log in.
Geometry const& geo = view->GetAbsolu teGeometry( ); el();
parent = view->GetToplev
As far as I can see, if this actually works, it works only by accident. This binds a C++ reference to the return value of a function. The return value is a temporary that will disappear the instant the function completes.
Further down in the function, we have:
m_dirty_ areas.push_ back(geo) ;
This looks like it pushes a dangling reference.