I have been working on a developer first, read-only first, safety first, Cloud Cost Analyzer. I focus on analyzing cloud infra for waste. It grew out of my time at AWS and then consulting, spelunking through AWS, Azure, (GCP soon) accounts, finding real waste infrastructure. Its primary mode of operation is a rust CLI that you the developer, can run on your workstation, github action, gitlab ci, jenkins, etc and create an actionable report / test that can be used to control costs while maintaining performance and never exposing your credentials, access tokens, etc.
You would be surprised at how many over / suboptimally-provisioned dbs, idle resources, forgotten EBS snapshots, outdated / previous-gen instance types, and vestigial networking that leads to nowhere I find.
jdcasale you are right that Arc<RwLock<T>> is a code smell but I would take that a bit further that locking immutable data is even more of a smell. The real bad guy in this case is the RwLock not Arc. For anything that you hydrated once and never mutate you do not need the RwLock. Arc just clones the pointer so it is safe to share for concurrent reads so something like Arc<T> is fine and if you need initialization locking then LazyLock<Arc<T>> lets you lock the initialization but then everything else is just a pointer copy.
I hit this recently while building a url unfurl social card renderer for a project which ended up being something like LazyLock<Arc<Database>>
The overuse of the phrase "code smell" is a skill level smell. Too much time spent cargo culting code elegance, not enough time spent in the byte mines.
Unfortunately (for your case) the ordering of group_by, join, and unique all run in parallel hash aggregation across the threads so the output order comes about by how it gets partitioned across cores. Which is why you can get different order of rows depending on the machine even when you have the same set of data and polars version (this has happened to me). To fix you can set maintain_order=True or probably better an explicit sort whereever you save or compare / diff the output.
You would be surprised at how many over / suboptimally-provisioned dbs, idle resources, forgotten EBS snapshots, outdated / previous-gen instance types, and vestigial networking that leads to nowhere I find.
If you want to check it out https://cca.dragonfractal.com
reply