Conversation
|
Unfortunately, I get very similar results, so I don't think it solves #569. |
|
I'll take a look at this one, but it would have been very nice if the diff had been minimal rather than including a sleuth of other changes. |
|
I would be curious to learn whether there's any performance/memory usage difference. |
|
Using some simple irept tests I had built some time ago the only observable difference in memory consumption is the size of an irept, which now is the size of two pointers instead of just one: |
|
On Thu, 2017-03-23 at 11:37 -0700, Michael Tautschnig wrote:
Using some simple irept tests I had built some time ago the only observable difference in memory consumption is the size of an irept, which now is the size of two pointers instead of just one:
I'm mildly concerned by this. Memory consumption is a serious issue for
some users.
|
|
Well, as far as I understand we are just moving those extra bytes out of the inner structure, which would always get allocated together with an |
|
To clarify my surprise: the gap is now just replaced by padding, so we do end up with some overhead. Proper measurements at large scale are due, though. |
ireptwas doing manual reference-counting. Applying the single responsibility principle, we replace manual pointer/refcount manipulation withstd::shared_ptr, so that the innerdtclass does not have the dual responsibilities of maintaining a reference count and storing the object data members. Usingshared_ptrimproves the maintainability of the code, as it is a well-known and well-documented abstraction.shared_ptralso allows us to use the compiler-generated special member functions, so that there is less overall code to maintain.