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

[topsites] Refactor the code to make it more modular #2027

Open
3 tasks
karlcow opened this issue Jan 19, 2018 · 1 comment
Open
3 tasks

[topsites] Refactor the code to make it more modular #2027

karlcow opened this issue Jan 19, 2018 · 1 comment

Comments

@karlcow
Copy link
Member

karlcow commented Jan 19, 2018

To make the code slightly more readable in the future, we could probably gain by making it more modular. Previous issue about it was #2015

  • break down with more functions
  • separate the strings in a file as string templates.
  • adds more tests

See https://github.com/webcompat/webcompat.com/blob/2fb2e27253ae86d00a2d304395e39246fc0d923f/tools/topsites.py
and https://github.com/webcompat/webcompat.com/blob/2fb2e27253ae86d00a2d304395e39246fc0d923f/tests/unit/test_topsites.py

@karlcow
Copy link
Member Author

karlcow commented Dec 18, 2019

When doing that. The current code takes 6 minutes to run (aka create a new db).
There might be optimization refactoring to do.
Why it's not really an issue for now. We run it only once a month… so 6 minutes for once a month is not necessary an issue to solve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant