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

Slow performance #18

Open
tigattack opened this issue Nov 28, 2024 · 0 comments
Open

Slow performance #18

tigattack opened this issue Nov 28, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@tigattack
Copy link
Collaborator

> time python3 main.py get_accounts

This takes anywhere between 500-1200ms.


from time import perf_counter
time_start = perf_counter()

from simplepycons import all_icons

time_duration = perf_counter() - time_start
print(f'Took {time_duration:.3f} seconds')

First run: Took 0.873 seconds
Second run: Took 0.395 seconds


As can clearly be seen, simplepycons is the real slowdown here.

My plan (when I get the time and motivation 👀) is to rip out simplepycons, replacing it as follows (assuming licencing allows - haven't checked):

If customisations to the SVG are required to add colour customisations, create a GHA workflow to mirror the contents of simple-icons/simple-icons/icons and the simple-icons/simple-icons/_data/simple-icons.json file into this repo and apply the necessary changes to each SVG to support colour customisation.

If not, we could optionally add simple-icons as a submodule rather than cloning the icons. I think I'd still prefer to clone, though, given we don't need the entire repo contents.

We should also mirror the contents of ente-io/ente/auth/assets/custom-icons/icons and the ente-io/ente/auth/assets/custom-icons/_data/custom-icons.json file into this repo.

We can then include all of these icons in the built package, distributing them with the workflow along with any required customisations to apply colours.

In mirroring all of these icons, we avoid the need to perform slow icon searching from multiple sources at import runtime as we already have a full, local DB of icons.

Again, this is all assuming that the licencing of both simple-icons/simple-icons and ente-io/ente allows for this plan.

@tigattack tigattack self-assigned this Nov 28, 2024
@tigattack tigattack added the enhancement New feature or request label Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant