Commit Graph

17 Commits

Author SHA1 Message Date
Karl Seguin
b3a0aaaeea Enable v8 snapshots
There are two layers here. The first is that, on startup, a v8 SnapshotCreator
is created, and a snapshot-specific isolate/context is setup with our browser
environment. This contains most of what was in Env.init and a good chunk of
what was in ExecutionWorld.createContext. From this, we create a v8.StartupData
which is used for the creation of all subsequent contexts. The snapshot sits
at the application level, above the Env - it's re-used for all envs/isolates, so
this gives a nice performance boost for both 1 connection opening multiple pages
or multiple connections opening 1 page.

The second layer is that the Snapshot data can be embedded into the binary, so
that it doesn't have to be created on startup, but rather created at build-time.
This improves the startup time (though, I'm not really sure how to measure that
accurately...).

The first layer is the big win (and just works as-is without any build / usage
changes).

with snapshot
total runs 1000
total duration (ms) 7527
avg run duration (ms) 7
min run duration (ms) 5
max run duration (ms) 41

without snapshot
total runs 1000
total duration (ms) 9350
avg run duration (ms) 9
min run duration (ms) 8
max run duration (ms) 42

To embed a snapshot into the binary, we first need to create the snapshot file:

zig build -Doptimize=ReleaseFast snapshot_creator -- src/snapshot.bin

And then build using the new snapshot_path argument:

zig build -Dsnapshot_path=../../snapshot.bin -Doptimize=ReleaseFast

The paths are weird, I know...since it's embedded, it needs to be inside the
project path, hence we put it in src/snapshot.bin. And since it's embedded
relative to the embedder (src/browser/js/Snapshot.zig) the path has to be
relative to that, hence ../../snapshot.bin. I'm open to suggestions on
improving this.
2025-12-18 20:10:38 +08:00
Pierre Tachoire
22303d2ae8 Merge pull request #1236 from lightpanda-io/v8-build-with-zig-gclient-ci
V8 build with zig gclient ci
2025-12-18 11:55:55 +08:00
Halil Durak
d23eacbd37 update .gitignore
LSPs seem to generate the `target` directory when navigating these files through editor.
2025-11-26 14:28:18 +03:00
Halil Durak
6280232e91 add a build step for html5ever in build.zig 2025-11-26 14:20:39 +03:00
Karl Seguin
b047cb6dc1 remove libdom 2025-10-27 22:14:59 +08:00
Karl Seguin
f6c43eaf9c Fix dockerfile (hopefully)
Add dummy --json stats output to tests

Comment typos fixed

Add make get-v8, build-v8 and build-v8-dev make targets
2025-04-15 15:18:06 +08:00
Karl Seguin
b8d7744563 replace zig-js-runtime 2025-04-15 15:18:04 +08:00
Karl Seguin
53f6e66c23 Remove plausible, leave a dummy provider for now
Add batching, add install optional id (persisted) and execution id (per run)
2025-03-18 08:02:09 +08:00
Francis Bouvier
b9bae3f66d build: update gitignore
Signed-off-by: Francis Bouvier <francis@lightpanda.io>
2024-10-30 13:41:48 +01:00
Pierre Tachoire
6da2954e0b upgrade to zig 0.13 2024-07-19 14:32:47 +02:00
Pierre Tachoire
52d3f3e966 deps: remove lexbor 2024-03-28 11:13:17 +01:00
Pierre Tachoire
d7fec31b8a build libiconv from sources 2023-09-22 16:10:22 +02:00
Francis Bouvier
1f61eaff9d Makefile: use make install for install-netsurf
Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com>
2023-09-20 22:42:06 +02:00
Francis Bouvier
97348cef5c Add netsurf submodules
Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com>
2023-09-06 17:51:43 +02:00
Pierre Tachoire
3bfefcb047 vendor: seperate lexbor source from build
* add `vendor/lexbor-src` submodule
* build lexbor static lib into `vendor/lexbor`
2023-09-01 16:00:27 +02:00
Pierre Tachoire
85c5662dbc vendor: add lexbor deps submodule 2023-09-01 16:00:25 +02:00
Francis Bouvier
497a1119f8 Initial commit
Signed-off-by: Francis Bouvier <francis.bouvier@gmail.com>
2023-02-07 16:22:01 +01:00