Commit 0554ae3
committed
Removed unnecessary overhead from Object::copy().
The shared_ptr machinery has a pretty significant overhead when copying small objects - this change gives almost a 50% reduction in runtime in a benchmark which copies many small data objects (where lazy-copy-on-write defers most of the real work anyway).
There were a few unecessary overheads :
- Allocating the CopyContext on the heap.
- Using a shared_ptr
- Allocates another heap object for use as a reference count.
- Uses atomic operations to increment and decrement the reference count.1 parent 16debfd commit 0554ae3
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
315 | | - | |
316 | | - | |
| 315 | + | |
| 316 | + | |
317 | 317 | | |
318 | 318 | | |
319 | 319 | | |
| |||
0 commit comments