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

feat: Begin replacing old progress bars with Rich bars #169

Merged
merged 11 commits into from
May 6, 2024

Conversation

kfsone
Copy link
Contributor

@kfsone kfsone commented May 6, 2024

  • leverages the previously built 'rich' integration,
  • exposes several types of progress bar,
  • provides a contextmanager method for wrapping work with progress bars,
  • progress updates are asynchronous so they don't slow down processing so much,
  • integrates the progress bars with cache building and downloads,
  • some perf tweaks to Station imports,
  • some perf tweaks to eddblink prices imports (may need further tuning),
  • calling self.tdenv.DEBUGX adds up to about ~2s of processing time when importing prices, because of python call overhead so I put it behind a conditional,
  • fixed some linting and other minor issues,
  • minor tidy up
  • add StationDemand and StationSupply tables for future use
    • an initial test importing to these tables instead of StationItem reduced clean EDDB import from ~30 minutes to 5.

Suggest you try running this a few times to decide if you like how the bars look, where they're used, etc.

Once this is landed, I'm going to finish off changes to eddblink that reduces the time it takes to collect all the "is this file out of date?" by doing them over a single HTTPS connection.

kfsone added 9 commits May 5, 2024 22:22
This introduces an enhancement over the old progress bars, using rich to provide colorful, live bars. Base types for skinning them are included.
uses the new rich-based progress bars to display download speed information etc.
- make bars hideable,
- polish,
- default the progress bar to visible, require show=False explicitly.
- add more bar styles,
- use some of the bars,
- Remove ROWID from Station table to improve performance,
- Introduce StationDemand and StationSupply tables for breaking up StationItem,
- Reduce size of station/system index,
- advance progress bars properly,
- actually display the text of the progress bar, duh
Line CountingBar except it includes a TimeRemaining column (long running tasks seem to warrant this)
- small tweaks to improve performance of eddblink import,
- commit batching to try and improve eddblink import speed,
- use rich progress bars to give better insight into commit rate

one interesting thing to try is to change the progress bar description around the COMMIT while importing prices:

```
prog.increment(description="COMMIT")
cursor.execute("COMMIT")
transaction_items = 0
cursor.execute("BEGIN TRANSACTION")
prog.increment(description="Processing")
```

and then adjust the batch size. when batchsize is too low, this makes the description flicker, but you can get a sense for how increasing the batch size reduces the total import time until the amount of memory/wal etc starts to make the commit time excessively long
@kfsone
Copy link
Contributor Author

kfsone commented May 6, 2024

ProgressBars.mp4

@kfsone kfsone force-pushed the feat/use-rich-pbars branch from ba8900e to 4ecf0da Compare May 6, 2024 08:15
@eyeonus eyeonus merged commit aab81db into eyeonus:release/v1 May 6, 2024
14 checks passed
@kfsone kfsone deleted the feat/use-rich-pbars branch May 6, 2024 18:25
@kfsone kfsone restored the feat/use-rich-pbars branch May 6, 2024 18:25
@kfsone kfsone deleted the feat/use-rich-pbars branch May 6, 2024 18:25
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