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

Speed up writing C3D-files from python #218

Merged
merged 4 commits into from
Aug 10, 2021
Merged

Speed up writing C3D-files from python #218

merged 4 commits into from
Aug 10, 2021

Conversation

Kilidsch
Copy link
Contributor

This PR speeds up the c3d.write() call in python. This is done by 2 ways:

  1. The filling of the new_c3d-object was moved from Python to C++
  2. The Label-Check was impoved ( not by me, but by @pariterre )

The results in the following improvements on c3d.write() on the example file Cortex.c3d` on my machine:

Method Time in seconds
Original/Old 5.2061723
new_c3d filled in C++ 2.2334236
new_c3d filles in C++ and improved Label-Check 0.4963968

So in this particular example we see an 10x speed improvement.


I don't know if the code changes will be covered by existing tests. They should be though, since writing to disk is no new functionality.

If I deviate from the coding style of the rest of the code base too much, please tell me how to improve.

Copy link
Member

@pariterre pariterre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@codecov
Copy link

codecov bot commented Aug 10, 2021

Codecov Report

Merging #218 (79c890e) into dev (726e4f8) will increase coverage by 0.00%.
The diff coverage is 75.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev     #218   +/-   ##
=======================================
  Coverage   97.86%   97.86%           
=======================================
  Files          22       22           
  Lines        4725     4728    +3     
=======================================
+ Hits         4624     4627    +3     
  Misses        101      101           
Impacted Files Coverage Δ
src/ezc3d.cpp 96.46% <75.00%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 726e4f8...79c890e. Read the comment docs.

@pariterre
Copy link
Member

GG!

@pariterre pariterre merged commit 753bf2e into pyomeca:dev Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants