Skip to content

Optimizations for the exponential backoff and for indexing the sqlite db#70

Merged
abidlabs merged 27 commits into
gradio-app:mainfrom
stabgan:main
Jul 1, 2025
Merged

Optimizations for the exponential backoff and for indexing the sqlite db#70
abidlabs merged 27 commits into
gradio-app:mainfrom
stabgan:main

Conversation

@stabgan
Copy link
Copy Markdown
Contributor

@stabgan stabgan commented Jun 27, 2025

Word lists for generating readable names and the simplify regex are now module-level constants for faster access
A new downsample_df() helper trims large data sets before plotting, keeping dashboards responsive
CSV import uses numeric column detection with select_dtypes() and iterates rows efficiently with itertuples()
SQLite initialization creates a composite index to speed up project/run lookups
Project discovery scans databases using a set for unique names
optimize column simplification and name generation
add project index caching and metrics cache
improve update_last_steps and run caching
simplify downsample algorithm
revise wait_until_space_exists backoff

stabgan added 4 commits June 27, 2025 19:28
hoist adjective/noun lists and regex into module-level constants
speed up name generation and column simplification
improve numeric detection & row iteration for CSV import
create composite index on project/run/step
refactor project lookup using set and SQL
fix wait_until_space_exists retry logic
add downsample_df and use it in UI plots
ensure tests import local package and add utils tests
@stabgan
Copy link
Copy Markdown
Contributor Author

stabgan commented Jun 28, 2025

@abidlabs I have fixed the minor ruff formatting.
This is my first time contributing to an open source project.
I heavily used wandb, and I am an AI researcher. I really wanted a local alternative. So, I am eager to make it super efficient and fast for tracking my own experiments and plots locally. I have a lot of 2D and 3D graphs for statistical learning, that I need to store experiments by experiments like a chapter.

I am optimising the low hanging fruits that I am spotting.
I don't know much about how to contribute. If you want, you can take the optimisations one by one from my file changes and apply on your own and check for yourself.

Highly recommend checking my current state of the pull request locally first to see if anything breaks, as you know the best about this project.

And I have fixed the ruff formatting issue, there needed to be a line space between all functions.

@abidlabs
Copy link
Copy Markdown
Member

Thanks @stabgan for the great optimizations! @znation or myself will go through the changes and hopefully merge & do a new release this week.

@abidlabs
Copy link
Copy Markdown
Member

abidlabs commented Jul 1, 2025

Hi @stabgan I started looking through this and while I appreciate the PR, it's a little hard to understand the rationale for all of the changes. For now, I'll just cherry pick the specific changes which seem like the most impactful optimizations and those I understand clearly and revert the rest. If there are other changes you'd like to see, it would be great if you would open individual PRs with those changes. Thanks!

@abidlabs
Copy link
Copy Markdown
Member

abidlabs commented Jul 1, 2025

Hi @stabgan thanks again for the suggested changes. To keep this PR more atomic, I've only kept the optimizations for the exponential backoff and for indexing the sqlite db. I'm sure there's changes in other values but it was hard to parse / test with all of them in a single PR, so feel free to make individual PRs with those changes. Will merge this in and do a release soon!

@abidlabs abidlabs changed the title Many optimisations and speed improvement. All tests passing. Optimizations for the exponential backoff and for indexing the sqlite db Jul 1, 2025
@abidlabs abidlabs merged commit 1983398 into gradio-app:main Jul 1, 2025
2 checks passed
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.

2 participants