mirror of
https://github.com/slint-ui/slint.git
synced 2025-12-23 09:19:32 +00:00
This removes a lot of allocations and speeds up the compiler step
a bit. Sadly, this patch is very invasive as it touches a lot of
files. That said, each individual hunk is pretty trivial.
For a non-trivial real-world example, the impact is significant,
we get rid of ~29% of all allocations and improve the runtime by
about 4.8% (measured until the viewer loop would start).
Before:
```
Benchmark 1: ./target/release/slint-viewer ../slint-perf/app.slint
Time (mean ± σ): 664.2 ms ± 6.7 ms [User: 589.2 ms, System: 74.0 ms]
Range (min … max): 659.0 ms … 682.4 ms 10 runs
allocations: 4886888
temporary allocations: 857508
```
After:
```
Benchmark 1: ./target/release/slint-viewer ../slint-perf/app.slint
Time (mean ± σ): 639.5 ms ± 17.8 ms [User: 556.9 ms, System: 76.2 ms]
Range (min … max): 621.4 ms … 666.5 ms 10 runs
allocations: 3544318
temporary allocations: 495685
```
60 lines
2.4 KiB
TOML
60 lines
2.4 KiB
TOML
# Copyright © SixtyFPS GmbH <info@slint.dev>
|
|
# SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-2.0 OR LicenseRef-Slint-Software-3.0
|
|
|
|
[package]
|
|
name = "slint-node"
|
|
description = "Internal Slint Runtime Library for NodeJS API."
|
|
authors.workspace = true
|
|
documentation.workspace = true
|
|
edition.workspace = true
|
|
homepage.workspace = true
|
|
keywords.workspace = true
|
|
license.workspace = true
|
|
repository.workspace = true
|
|
rust-version.workspace = true
|
|
version.workspace = true
|
|
categories = ["gui", "development-tools"]
|
|
build = "build.rs"
|
|
|
|
[lib]
|
|
crate-type = ["cdylib"]
|
|
path = "rust/lib.rs"
|
|
|
|
[features]
|
|
default = ["backend-winit", "renderer-femtovg", "renderer-software", "backend-qt", "accessibility"]
|
|
# Keep in sync with features in nightly_snapshot.yaml, cpp_package.yaml, slint_tool_binary.yaml, and api/python/Cargo.toml
|
|
# binaries: default = ["backend-linuxkms-noseat", "backend-winit", "renderer-femtovg", "renderer-skia", "accessibility"]
|
|
|
|
backend-qt = ["slint-interpreter/backend-qt"]
|
|
backend-winit = ["slint-interpreter/backend-winit"]
|
|
backend-winit-x11 = ["slint-interpreter/backend-winit-x11"]
|
|
backend-winit-wayland = ["slint-interpreter/backend-winit-wayland"]
|
|
backend-linuxkms = ["slint-interpreter/backend-linuxkms"]
|
|
backend-linuxkms-noseat = ["slint-interpreter/backend-linuxkms-noseat"]
|
|
renderer-femtovg = ["slint-interpreter/renderer-femtovg"]
|
|
renderer-skia = ["slint-interpreter/renderer-skia"]
|
|
renderer-skia-opengl = ["slint-interpreter/renderer-skia-opengl"]
|
|
renderer-skia-vulkan = ["slint-interpreter/renderer-skia-vulkan"]
|
|
renderer-software = ["slint-interpreter/renderer-software"]
|
|
accessibility = ["slint-interpreter/accessibility"]
|
|
|
|
# Removed by node_package xtask
|
|
testing = ["dep:i-slint-backend-testing"]
|
|
|
|
[dependencies]
|
|
napi = { version = "2.14.0", default-features = false, features = ["napi8"] }
|
|
napi-derive = "2.14.0"
|
|
i-slint-compiler = { workspace = true, features = ["default"] }
|
|
i-slint-core = { workspace = true, features = ["default", "gettext-rs"] }
|
|
i-slint-backend-selector = { workspace = true }
|
|
slint-interpreter = { workspace = true, default-features = false, features = ["display-diagnostics", "internal", "compat-1-2"] }
|
|
spin_on = { workspace = true }
|
|
css-color-parser2 = { workspace = true }
|
|
itertools = { workspace = true }
|
|
send_wrapper = { workspace = true }
|
|
# Removed by node_package xtask
|
|
i-slint-backend-testing = { workspace = true, optional = true }
|
|
smol_str = { workspace = true }
|
|
|
|
[build-dependencies]
|
|
napi-build = "2.1.0"
|