[performance] Mir spends 12%+ CPU time in get_hooked_symbol (libhybris-common) comparing strings
Bug #1343198 reported by
Daniel van Vugt
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Mir |
Invalid
|
Medium
|
Daniel van Vugt | ||
libhybris (Ubuntu) |
Fix Released
|
Medium
|
Daniel van Vugt |
Bug Description
On the N4, Mir spends 12%+ CPU time in get_hooked_symbol (libhybris-common). Actually callgrind can't decide; it's somewhere between 12% and 46000% ;)
So it's big. Looking at the hybris code, there's a rather large bottleneck that's obvious: get_hooked_symbol does a linear search (many times) of a large list of strings using strcmp alone. That's why 22132 calls to get_hooked_symbol are yielding over 5 million calls to strcmp.
Upstream hybris appears to have been modified to use a cache/hashing instead of the ugly linear search we have.
Related branches
Changed in libhybris (Ubuntu): | |
assignee: | nobody → Daniel van Vugt (vanvugt) |
status: | New → In Progress |
summary: |
- Mir spends 12%+ CPU time in get_hooked_symbol (libhybris-common) + [android] Mir spends 12%+ CPU time in get_hooked_symbol (libhybris- + common) |
summary: |
[android] Mir spends 12%+ CPU time in get_hooked_symbol (libhybris- - common) + common) comparing strings when it should be rendering |
summary: |
- [android] Mir spends 12%+ CPU time in get_hooked_symbol (libhybris- + [performance] Mir spends 12%+ CPU time in get_hooked_symbol (libhybris- common) comparing strings |
Changed in mir: | |
milestone: | 0.6.0 → none |
status: | In Progress → Invalid |
Changed in libhybris (Ubuntu): | |
assignee: | Daniel van Vugt (vanvugt) → nobody |
status: | In Progress → Triaged |
assignee: | nobody → Daniel van Vugt (vanvugt) |
To post a comment you must log in.
Hmm, consistent profile results seem to tell me that the offending code is possibly only called on startup. But if the startup code accounts for 12% of the CPU time of something I left rendering for several minutes, it's still worth fixing.