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

Rework Plugin / JCef exchange of file payload #198

Open
bric3 opened this issue Jan 12, 2024 · 0 comments
Open

Rework Plugin / JCef exchange of file payload #198

bric3 opened this issue Jan 12, 2024 · 0 comments
Milestone

Comments

@bric3
Copy link
Owner

bric3 commented Jan 12, 2024

Currently file are exchanged as base64 strings in a payload run by CefFrame::executeJavaScript, this is not optimal for several reasons :

  • Base 64 encoding increase the size by ~33 % (not even accounting the line breaks)
  • Given excalidraw can embed pictures, the payload can be even bigger.
  • Big strings (backed by an array) will cause on G1GC (the default on IJ at this time) to create humongous region if the string is bigger than half the region size (which by default depends on the total Java heap).
    • Java heap of 4 GiB usually have 2 MiB regions, so HO are created when content is over 1 MiB,
    • Java heap of 2 GiB usually have 1 Mib regions, so HO are created when content is over 512 KiB.

In order to improve that aspects there are multiple options

  1. Use "the server" that would be able to server and receive files
  2. Avoid facing the problem by changing the encode to uuEncoding. (Not a lot of implementation out there : https://github.com/biagioT/java-uudecoder)
  3. Explore approaches using browser file system APIs (may not be be supported by Cef)
@bric3 bric3 added this to the 0.4.1 milestone Jan 12, 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

No branches or pull requests

1 participant