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]: Add support for multithreading to improve performance #199

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

ssassi
Copy link

@ssassi ssassi commented Mar 9, 2025

Problem

After testing titan on a large data set of roles and users I concluded that multithreading is key to make the tool usable.
On my tests, it took ~1 hour to create 3000 roles and 1000 users, including user grants.
This scenario could be normal on enterprise.

Solution

This PR adds multithreading, defaulting to 8 threads. I kept the dynamic role switching, and introduced the computation of execution levels to run the sql statements in the correct order.

On my tests, the same resources were created in ~8 minutes.

NOTE: I created this over the weekend and of course needs testing, take this as a draft PR to start reviewing/improving.

@ssassi ssassi changed the title Add support for multithreading to improve performance. DRAFT: Add support for multithreading to improve performance. Mar 9, 2025
@ssassi ssassi changed the title DRAFT: Add support for multithreading to improve performance. [FEAT]: DRAFT Add support for multithreading to improve performance. Mar 9, 2025
@ssassi ssassi changed the title [FEAT]: DRAFT Add support for multithreading to improve performance. [FEAT]: Add support for multithreading to improve performance [DRAFT] Mar 9, 2025
@ssassi ssassi had a problem deploying to snowflake-aws-standard March 13, 2025 03:21 — with GitHub Actions Failure
@ssassi ssassi had a problem deploying to snowflake-aws-enterprise March 13, 2025 03:21 — with GitHub Actions Failure
@ssassi ssassi had a problem deploying to snowflake-aws-business-critical March 13, 2025 03:21 — with GitHub Actions Failure
@ssassi ssassi had a problem deploying to snowflake-azure-standard March 13, 2025 03:21 — with GitHub Actions Failure
@ssassi ssassi had a problem deploying to snowflake-gcp-standard March 13, 2025 03:21 — with GitHub Actions Failure
@teej
Copy link
Collaborator

teej commented Mar 13, 2025

I'll have to figure out how to get test connection auth running properly for non-core contributors. Interesting PR. AI edits removed a bunch of comments unfortunately.

Sebastian Sassi added 4 commits March 13, 2025 09:55
@ssassi ssassi changed the title [FEAT]: Add support for multithreading to improve performance [DRAFT] [FEAT]: Add support for multithreading to improve performance Mar 27, 2025
@ssassi
Copy link
Author

ssassi commented Mar 27, 2025

I've tested it deeper and fixed some bugs while running on sync mode. Also restored comments changed.
Let me know your thoughts.

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.

None yet

2 participants