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

calculate_stats.py loop computes some stats that are unused by the dashboard #129

Open
andylolz opened this issue Jun 7, 2018 · 2 comments
Assignees

Comments

@andylolz
Copy link
Contributor

andylolz commented Jun 7, 2018

calculate_stats.py loop takes a reeeeally long time to run.

Profiling suggests by_hierarchy is the slowest function. validation, codelist_values and codelist_values_by_major_version are pretty slow, too.

ruleset_passes is not only slow, it’s also unused by the dashboard. So that can and probably should be disabled.

@andylolz
Copy link
Contributor Author

andylolz commented Jun 7, 2018

In case it’s useful to know, you can disable stats by prefixing their function name with an underscore:

def use_stat(stats, name):
if hasattr(stats, 'enabled_stats'):
return name in stats.enabled_stats
else:
return not name.startswith('_')

@andylolz
Copy link
Contributor Author

andylolz commented Jun 7, 2018

codelist_values and codelist_values_by_major_version are both quite expensive. They also do almost exactly the same thing as each other.

It wouldn’t be difficult to scrap codelist_values, and refactor the dashboard to use list(codelist_values_by_major_version.values())[0] in place of codelist_values.

@Ocre42 Ocre42 self-assigned this Jan 16, 2019
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

No branches or pull requests

2 participants