Core Architecture Refactor: Enum Dispatch, Zero-Allocation Rows & Workspace Migration#45
Closed
Einswilli wants to merge 299 commits into
Closed
Core Architecture Refactor: Enum Dispatch, Zero-Allocation Rows & Workspace Migration#45Einswilli wants to merge 299 commits into
Einswilli wants to merge 299 commits into
Conversation
Add CI workflow actions
This PR adds unit tests for exceptions, fields, models, query sets and validations.
This PR adds integration tests for crud ops, bulk ops, queries, query sets and transactions. It also adds a `test.py` script for running tests.
Add readme and contribution guide.
Benchmarks switched from Vec to smallvec::SmallVec<[SqlValue; 8]> to reduce heap allocations and use SqlWriter for SQL emission. QNode field strings were changed from to_string() to .into(), JSON list values are boxed and built with smallvec::smallvec!, and compile_q calls now accept a mutable SqlWriter. In the compiler, SqlWriter constructors (new_emit, new_no_emit) and fork() were made public so tests/benches can instantiate and reuse writers.
… update" This reverts commit fb507bd.
…s and implement high-performance enum dispatch
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements a major architectural overhaul of Ryx to move from a dynamic,
sqlx::Any-based system to a high-performance, statically dispatched architecture. The primary goal is to minimize latency in the hot path (ORM and Raw Core) by eliminating vtable lookups and reducing heap allocations during data retrieval.Key Changes
🏗️ Architecture & Project Structure
ryx-core: Base types, errors, and the new unified type system.ryx-backend: Database-specific implementations and connection management.ryx-python: PyO3 bindings and Python-facing logic.ryx-query: SQL AST and compilation logic.⚡ Performance Optimizations
dyn RyxBackendandsqlx::AnywithRyxConnectionandRyxTransactionenums. This allows the compiler to inline backend-specific code and removes the overhead of dynamic dispatch.HashMap<String, SqlValue>with aRowView(aVecof values referencing a sharedRowMapping).py_to_sql_valueby usingtype_ptr()comparisons instead of a trial-and-error casting cascade.🛠️ Transaction & Connection Management
RyxExecutortrait for raw query execution.PyTransactionHandle.Performance Impact