Necessary Maintenance #5281
Move to using make_shared() wherever possible and appropriate.
100%
Description
make_shared()
, when used consistently in preference to shared_ptr<>(new ...)
, is significantly faster. Where it is straightforward to do, we should do this.
History
#1 Updated by Rob Kutschke almost 7 years ago
Chris: maybe a short presentation at the stakeholders meeting would be a good idea? What's going on under the covers and where, in typical experimental code, is it important.
#2 Updated by Christopher Green almost 7 years ago
- Status changed from New to Accepted
- Priority changed from Normal to Low
- Estimated time set to 8.00 h
This is a, "low-hanging fruit" issue, making the code conform to current best practice and getting a performance improvement into the bargain. Basically the idea is to take advantage of the fact that make_shared
allocates the memory for the reference counter contiguous with the saved object, and reducing the number of unnecessary shared_ptr
copies by using references reduces the churn on the reference counter, thereby also improving performance. If experiments wish to do this in their own code there should be no issues with respect to whether or not art does the same thing (or vice versa).
#3 Updated by Christopher Green almost 7 years ago
- Tracker changed from Feature to Necessary Maintenance
#4 Updated by Christopher Green almost 7 years ago
- Description updated (diff)
#5 Updated by Kyle Knoepfel almost 6 years ago
- Target version set to 521
#6 Updated by Kyle Knoepfel about 3 years ago
- Target version deleted (
521)
#7 Updated by Kyle Knoepfel about 1 year ago
- % Done changed from 0 to 100
- Status changed from Accepted to Resolved
#8 Updated by Kyle Knoepfel about 1 year ago
- Status changed from Resolved to Closed