G-Node / G-Node/nix

Optimize frontend+backend object instantiation

Open
#196 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
72
Forks
36
PR merge metrics
No merged PRs in 30d

Description

Currently the stats obtained via dtrace for all our tests, i.e. using dtrace on TestRunner, are the following:

```
Block::shrd_ctor_copy 1977
DataArray::shrd_ctor_copy 1123
DataTag::shrd_ctor_copy 71
Dimension[Range]::shrd_ctor_copy 15
Dimension[Set]::shrd_ctor_copy 14
File::shrd_ctor_copy 6737
ImplContainer::ctor_copy 998
ImplContainer::ctor_empty 13554
ImplContainer::ctor_total 28381
ImplContainer::shrd_ctor_copy 13829
ImplContainer::shrd_ctor_total 13829
Property::shrd_ctor_copy 102
Section::shrd_ctor_copy 1888
SimpleTag::shrd_ctor_copy 77
Source::shrd_ctor_copy 1822
```

This means in total we create 28381 `ImplContainer` based objects, 13554 of them are uninitialised, i.e. created via the constructor that takes no args (`ctor_empty`), and 13829 objects are initialised via the constructor that takes the a const reference to the `shared_ptr`, which then in turn copy-constructs the to-be-constructed-`ImplContainer`'s `shared_ptr`.
I very much suspect that we do some unnecessary copies since all of our current objects lack any move operation support.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.