-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
Lowering level for multi-threading #1305
Comments
The problem with multi-threading at the driver level is that the thread would be running C code, not user-land JavaScript (unless the thread hosted its own instance of of V8, which would have significant overhead and gotchyas), thus, many of the features supported by
I'm surprised that the overhead you're experiencing is so high. It could be worth investigating that further. |
How are you measuring this? Serialization of ipc messages can synchronously blocks both main / render (losing all concurrency). So this might be an issue with how you're setting things up.
How is this implemented? Via ipc or HTTP? It would be great if you could provide a minimal Electron app that demonstrates the different approaches and performance issues. |
Measuring my endpoints start and end timestamps. The only step these endpoints perform are SQL queries.
The communication between Renderer and Main is made through Electron IPC indeed. I will share a minimal app to showcase the different behaviours. |
If you use Electron's |
Also keep in mind that sometimes it's JSON serialization and deserialization which is slow, not the actual IPC data transfer. In that case, reduce the amount of JSON (de)serialization necessary. |
Hi! My Electron application opens a SQLite connection through
BetterSQLite3
from a Electron Renderer process with Node integration enabled.To test concurrency I did the following experiments:
In both scenarios the communication overhead was extremely noticeable.
All my queries are handled by SQLite in less than 25ms, with these two approaches the total roundtrip duration goes from 2x to 10x.
I am wondering if handling multi-threading at the driver level could avoid the communication overhead experienced when handling it at the application level. Do you have any idea on this? Is it even possible in Electron to manage thread at a native level?
Thank you for your time
The text was updated successfully, but these errors were encountered: