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

Optimize metadata calculation #229

Merged
merged 5 commits into from Aug 24, 2018
Merged

Optimize metadata calculation #229

merged 5 commits into from Aug 24, 2018

Conversation

kmax12
Copy link
Contributor

@kmax12 kmax12 commented Aug 23, 2018

Currently, we recalculate the metadata for an entityset every time the property is accessed. This slows done many operations in Featuretools.

This pull request refactors things so we only calculate the metadata if it hasn't been created yet or if an operation invalidated it.

Locally this change makes the tests run in 134 seconds vs 513 without this change.

@codecov-io
Copy link

codecov-io commented Aug 23, 2018

Codecov Report

Merging #229 into master will increase coverage by 0.03%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #229      +/-   ##
==========================================
+ Coverage   93.58%   93.61%   +0.03%     
==========================================
  Files          71       71              
  Lines        7727     7766      +39     
==========================================
+ Hits         7231     7270      +39     
  Misses        496      496
Impacted Files Coverage Δ
featuretools/entityset/entityset.py 94.35% <100%> (+0.05%) ⬆️
featuretools/entityset/entity.py 88.86% <100%> (+0.05%) ⬆️
featuretools/tests/entityset_tests/test_es.py 99.35% <100%> (+0.04%) ⬆️

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 4970660...00518fa. Read the comment docs.

@kmax12 kmax12 requested a review from rwedge August 23, 2018 19:05
@rwedge
Copy link
Contributor

rwedge commented Aug 23, 2018

Wouldn't entity level operations like Entity.add_variable and Entity.update_data also invalidate the EntitySet metadata?

@kmax12
Copy link
Contributor Author

kmax12 commented Aug 24, 2018

added those and also refactored the metadata reset into a function called EntitySet.reset_metadata()

@kmax12 kmax12 merged commit 1ecca5f into master Aug 24, 2018
@rwedge rwedge mentioned this pull request Aug 28, 2018
@kmax12 kmax12 deleted the optimize-metadata branch October 2, 2018 21:41
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

3 participants