Hacker News new | ask | show | jobs
by rcfox 3355 days ago
Oh man, I wish I could use snapshots in the browser. In some extreme cases, I'm dealing with multi-minute startup times.
2 comments

I think v8 does cache machine code in some cases. There are a couple of flags in chrome://flags you'll want to look at:

V8 Caching Mode, V8 caching strategy for CacheStorage

https://v8project.blogspot.ca/2015/07/code-caching.html

Edit: Not the same as snapshots mentioned in the article

What kind of application are you building?
Electronics design software. :)

Most of the time is spent doing fine collisions with shapes coming out of an R-tree to build up a connection graph.

For the vast majority of designs, it's fast. For very dense, imported designs, it can get slow. (No two tools keep data in the same form, so translating leads to inefficiencies.)

I recently evaluated all online EDAs that I could find. Some of them where quite slow because they used SVG for rendering. I would love to see your tool, too. Unfortunately, I couldn't find it in your profile. Do you have a link?
https://upverter.com/

We use canvas, which saves us from the SVG DOM, but it also means managing the scene ourselves. If I ever get some time, I'd like to experiment with a WebGL renderer...

Do you have any blog posts or similar about how you're managing the scene graph? I've been thinking a lot about building a scene graph lately, and coordinate -> component mapping seems expensive in time and/or memory depending on how you do it.
That sounds less like startup inefficiency and more like the application doing actual work on startup. Have you tried caching it?
Isn't that what these V8 snapshots are?

> V8 snapshots allow Electron applications to execute some arbitrary JavaScript code and output a binary file containing a serialized heap with all the data that is left in memory after running a GC at the end of the provided script.