Skip to content

Conversation

@TheRustifyer
Copy link
Member

@TheRustifyer TheRustifyer commented May 1, 2025

✅ Legitimate Performance Improvements (likely contributors):

Singleton Initialization:

  • Canyon::init() now runs once and reuses the global instance.

  • Previous versions may have re-initialized the configuration and connections on every test (especially if instance() panicked and tests had to restart initialization).

  • This new OnceLock approach means fewer file reads, fewer TOML parses, and fewer Runtime::new() calls.

Avoiding Re-parsing the config file:

  • We’re no longer scanning directories and reloading/parsing the config in each test.

  • This is a huge win if your config file is large or complex.

Connection Caching:

  • DatabaseConnection::new() is now called only once per datasource.
  • Previously, each test might have created fresh connections or runtimes.

Tokio Runtime Reuse:

  • Creating and dropping a Runtime is expensive. Now you’re reusing a single one.

…y the piece of s*** of the public API of tiberius is making us go crazy
…king the internal pool to the user code (yet leaked, will be fixed)
…a safe way, while removing unneded complexities and/or unneeded lifetime specifications
…<CanyonRows, ...> providing a better fluent api over the returned results from the database(s)
@TheRustifyer TheRustifyer force-pushed the refactor/GH-65-general-refactor branch from 7508dd5 to 3fd130f Compare October 24, 2025 20:59
…bConnection for DatabaseConnector, owned, ref and mut ref types
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.

General refactor

2 participants