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

refactor(torii): queries for them to not block #2391

Closed
wants to merge 1 commit into from

Conversation

lambda-0x
Copy link
Contributor

@lambda-0x lambda-0x commented Sep 6, 2024

Stack:

⚠️ Part of a stack created by spr. Do not merge manually using the UI - doing so may have unexpected results.

@lambda-0x lambda-0x force-pushed the spr/main/6c5aebce branch 2 times, most recently from 9988fdb to e1f12c7 Compare September 6, 2024 14:06
Copy link

codecov bot commented Sep 6, 2024

Codecov Report

Attention: Patch coverage is 81.39535% with 16 lines in your changes missing coverage. Please review.

Project coverage is 68.30%. Comparing base (8f096a4) to head (6cca479).

Files with missing lines Patch % Lines
crates/torii/core/src/sql.rs 67.64% 11 Missing ⚠️
crates/torii/core/src/query_queue.rs 92.00% 4 Missing ⚠️
crates/torii/libp2p/src/server/mod.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@                  Coverage Diff                  @@
##           spr/main/b4b488fe    #2391      +/-   ##
=====================================================
+ Coverage              68.28%   68.30%   +0.02%     
=====================================================
  Files                    357      357              
  Lines                  47257    47310      +53     
=====================================================
+ Hits                   32270    32316      +46     
- Misses                 14987    14994       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


update_entity.updated_model = Some(wrapped_ty);
self.query_queue.push_publish(BrokerMessage::EntityUpdated(update_entity));
self.query_queue.push_publish_query(
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should ensure that set_model_member also works when parallelized

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any reason it wouldn't work?

@@ -291,6 +292,7 @@ impl<P: Provider + Sync> Relay<P> {
peer_id = %peer_id,
"Message set."
);
self.db.execute().await.unwrap();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should also execute the queries for the set_entity that is further down. Can we refactor the logic here to reuse the same self.db.execute() everywhere? We can add a function that sets the entity and directrly executes the db queries

@lambda-0x
Copy link
Contributor Author

while trying to test syncing the flippyflop world noticed that we are spending alot of time for poseidon hash calculation. will have to add a cache for it.
Screenshot 2024-09-06 at 16 39 16@2x

@lambda-0x
Copy link
Contributor Author

closing in favour of #2397

@lambda-0x lambda-0x closed this Sep 8, 2024
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.

2 participants