Closed
Bug 1204160
Opened 10 years ago
Closed 5 years ago
Implement a small object optimization for mozilla::Function
Categories
(Core :: MFBT, defect)
Core
MFBT
Tracking
()
RESOLVED
INVALID
| Tracking | Status | |
|---|---|---|
| firefox43 | --- | affected |
People
(Reporter: botond, Unassigned)
References
Details
Currently, mozilla::Function stores a UniquePtr to the object that stores the wrapped callable. This means every instance of mozilla::Function incurs a dynamic allocation.
We should consider implementing a small-object optimization, where if the size of the callable is smaller than a threshold (say, 16 bytes), the callable is stored in-line. libc++'s implementation of std::function does this. [1]
[1] https://github.com/llvm-mirror/libcxx/blob/6d9da5891f6628ffa9d2f382113a8231121aeee1/include/functional#L1564
Comment 1•5 years ago
|
||
Bug 1320752 removed mozilla::Function in favor of std::function, so this seems obsolete.
You need to log in
before you can comment on or make changes to this bug.
Description
•