Skip to content

General Refactor #72

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

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

General Refactor #72

wants to merge 128 commits into from

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)
… of a 8x on running the integration tests. This will likely impact the Canyon users with a massive performance boost
…o a small subset of contracts, according each one functionality
…ilder -> Query

Query is the DbConnection type now
…ds from the autogenerated enums, so the argument is now a code entity and not an str
…of a type for giving the user reflection elements over the type ident and the type matching database table name generated by Canyon
…OwnedValue depending on what db configuration features exists
…processed only once per procedural macro creation, and not per method invocation
chore: removed the + Display bound on the generic statement parameters that receives the sql sentences
…is internally generated (Care:! We broke the Tiberius implementation because the type requeriments of their api for the moment, is pending to be fixed)
…ding to a much better hygiene on the derive proc macro
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
1 participant