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

Ensure Client.Deactivate on browser close for better GC #401

Closed
hackerwins opened this issue Nov 4, 2024 · 2 comments · Fixed by #413
Closed

Ensure Client.Deactivate on browser close for better GC #401

hackerwins opened this issue Nov 4, 2024 · 2 comments · Fixed by #413
Labels
enhancement 🌟 New feature or request

Comments

@hackerwins
Copy link
Member

hackerwins commented Nov 4, 2024

What would you like to be added:

CodePair editor uses yorkie.Text, and during recent performance tests, we observed that as the amount of editing increases, the response time for PushPullChanges becomes slower. This issue was analyzed, revealing that yorkie.Text, based on RGA, has tombstones to execute simultaneously occurring operations. Even if content is deleted from editor, the tombstones occupy space, and while Yorkie implements GC mechanism to manage this, the effectiveness of GC relies on detaching clients that are no longer editing.

To ensure more effective GC, we need to guarantee the execution of Client.Deactivate upon browser closure. Since browser termination may happen unexpectedly, I suggest utilizing navigator.sendBeacon or fetch() with the keepalive option to implement this.

For reference, see the discussion about sending HTTP requests on page exit: Reliably Send an HTTP Request as a User Leaves a Page

Why is this needed:

Additional Information:

@hackerwins hackerwins added the enhancement 🌟 New feature or request label Nov 4, 2024
@github-project-automation github-project-automation bot moved this to Backlog in CodePair Nov 4, 2024
@devleejb
Copy link
Member

devleejb commented Nov 8, 2024

I’m not sure I fully understand.
Are you suggesting that client.deactivate should be translated into a REST API call using fetch() or sendBeacon?

Could you provide more explanation?

@devleejb
Copy link
Member

Related to yorkie-team/yorkie-js-sdk#928.

@devleejb devleejb mentioned this issue Nov 22, 2024
2 tasks
@github-project-automation github-project-automation bot moved this from Backlog to Done in CodePair Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement 🌟 New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants