Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SofaKernel] change data content copy on write condition #2285

Conversation

damienmarchal
Copy link
Contributor

@damienmarchal damienmarchal commented Aug 2, 2021

The Data's hold their actual content within a dedicated container called DataContentValue.
Two versions of this containers exists, on holding the data using a copy-on-write mechanism while an other is using a systematic copy.

Currently the selection is based on the content of DataTypeInfo, I found it more explicit and clear to rely on type_traits to select the proper DataContentValue version.

Caduceuse, 10 000 iterations:
  - master: 24.15 s
  - copy on write to true: 24.2 s
  - copy on write to false: 23.78 s
  - copy on write to is_scalar: 25.0 s
  - copy on write to !is_scalar: 23.0 s

collisionMultiple.scn, 1 000 iterations:
  - master: 15.9 s
  - copy on write to true: 15.9 s
  - copy on write to false: 14.7 s
  - copy on write to is_scalar: 16.3 s
  - copy on write to !is_scalar: 14.5 s
  
 beam16x16x76-hexafem-rk4-CPU.scn: 2000 iterations
  - master: 1 m 30
  - copy on write to true: 1 m 32
  - copy on write to false: 1 m 30 
  - copy on write to is_scalar:  1 m 26
  - copy on write to !is_scalar: 1 m 18
  
  TorusFall: 4000 iterations
  - master: 41.5 s
  - copy on write to true: 43.9 s
  - copy on write to false: 41.2 s 
  - copy on write to is_scalar: 43.3 s  
  - copy on write to !is_scalar: 42.5 s

By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@damienmarchal damienmarchal force-pushed the pr-change-datacontent-copy-on-write-condition branch from c72539a to 75e0b10 Compare August 2, 2021 15:30
@damienmarchal damienmarchal added pr: status to review To notify reviewers to review this pull-request refactoring Refactor code labels Aug 2, 2021
@hugtalbot
Copy link
Contributor

what test should be performed to check the performance impact @damienmarchal ?

@guparan guparan added pr: status wip Development in the pull-request is still in progress and removed pr: status to review To notify reviewers to review this pull-request labels Sep 1, 2021
@damienmarchal damienmarchal reopened this Sep 1, 2021
@damienmarchal damienmarchal force-pushed the pr-change-datacontent-copy-on-write-condition branch from 75e0b10 to 1e5ca06 Compare September 1, 2021 15:13
@damienmarchal damienmarchal added pr: status to review To notify reviewers to review this pull-request and removed pr: status wip Development in the pull-request is still in progress labels Sep 1, 2021
@damienmarchal
Copy link
Contributor Author

I just added the performances tests... not very significant on "classical" scenes. So for the moment I suggest keeping the two version of DataContentValue<> but merge de PR to remove the dependency to DataTypeInfo.

@damienmarchal
Copy link
Contributor Author

[ci-build]

@damienmarchal damienmarchal force-pushed the pr-change-datacontent-copy-on-write-condition branch from 831eeae to ed8ad20 Compare September 7, 2021 08:05
@damienmarchal damienmarchal force-pushed the pr-change-datacontent-copy-on-write-condition branch from ed8ad20 to 335284e Compare September 7, 2021 08:09
@guparan guparan added pr: status ready Approved a pull-request, ready to be squashed and removed pr: status to review To notify reviewers to review this pull-request labels Sep 8, 2021
@fredroy fredroy merged commit d839449 into sofa-framework:master Sep 8, 2021
@guparan guparan added this to the v21.12 milestone Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: status ready Approved a pull-request, ready to be squashed refactoring Refactor code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants