slint/internal/compiler
Milian Wolff f6da161dbb
Reduce SmolStr <-> &str conversions and copies (#6688)
SmolStr has an Arc internally for large strings. This allows
cheap copies of large strings, but we lose that ability
when we convert the SmolStr to a &str and then reconstruct a
SmolStr from that slice.

I was hoping for some larger gains here, considering the impact
of this code change, but it only removes ~50k allocations,
while the impact on the runtime is not noticeable at all.

Still, I believe this is the right thing to do.

Before:
```
        allocations:            2338981

  Time (mean ± σ):     988.3 ms ±  17.9 ms    [User: 690.2 ms, System: 206.4 ms]
  Range (min … max):   956.4 ms … 1016.3 ms    10 runs
```

After:
```
        allocations:            2287723

  Time (mean ± σ):     989.8 ms ±  23.2 ms    [User: 699.2 ms, System: 197.6 ms]
  Range (min … max):   945.3 ms … 1021.4 ms    10 runs
```
2024-11-19 10:07:16 +01:00
..
generator Change API to set the language with bundle translation 2024-11-17 11:40:02 +01:00
LICENSES Simplify commercial license (#3063) 2024-05-31 14:06:17 +02:00
llr Reduce SmolStr <-> &str conversions and copies (#6688) 2024-11-19 10:07:16 +01:00
lookup Replace compiler dependency on css-color-parser crate 2024-07-29 13:13:53 +02:00
parser Fix parsing of unfinished import statement 2024-10-22 09:35:46 +02:00
parser-test-macro API review of the slint interpreter Compiler api 2024-07-05 17:20:08 +02:00
passes Reduce SmolStr <-> &str conversions and copies (#6688) 2024-11-19 10:07:16 +01:00
tests Fix panic when calling expression containing un-called macro 2024-11-11 16:08:22 +01:00
widgets std-widgets: added horizontal-alignment to SpinBox (#6778) 2024-11-15 08:05:57 +00:00
build.rs Simplify commercial license (#3063) 2024-05-31 14:06:17 +02:00
builtin_macros.rs Also wrap langtype::Type::Struct in an Rc 2024-10-28 09:39:54 +01:00
builtins.slint std-widgets: added horizontal-alignment to SpinBox (#6778) 2024-11-15 08:05:57 +00:00
Cargo.toml Bundle translations (#6661) 2024-10-29 15:07:15 +01:00
diagnostics.rs LSP: record dependencies and invalid all dependents when a dependencies changes 2024-11-14 14:35:22 +01:00
embedded_resources.rs Signed DistanceField font rendering in swrenderer 2024-10-23 09:12:30 +02:00
expression_tree.rs LSP: Signature Help 2024-11-06 13:27:29 +01:00
fileaccess.rs Widget style: simplify -light/-dark handling 2024-08-20 16:55:15 +02:00
generator.rs Reduce SmolStr <-> &str conversions and copies (#6688) 2024-11-19 10:07:16 +01:00
langtype.rs Error when making a for over an empty array 2024-11-11 13:23:56 +01:00
layout.rs Reduce SmolStr <-> &str conversions and copies (#6688) 2024-11-19 10:07:16 +01:00
lexer.rs Simplify commercial license (#3063) 2024-05-31 14:06:17 +02:00
lib.rs LSP: record dependencies and invalid all dependents when a dependencies changes 2024-11-14 14:35:22 +01:00
literals.rs Use SmolStr in more places of the compiler infrastructure 2024-10-17 18:04:58 +02:00
llr.rs Bundle translations (#6661) 2024-10-29 15:07:15 +01:00
load_builtins.rs LSP: Signature Help 2024-11-06 13:27:29 +01:00
lookup.rs Reduce SmolStr <-> &str conversions and copies (#6688) 2024-11-19 10:07:16 +01:00
namedreference.rs Reduce SmolStr <-> &str conversions and copies (#6688) 2024-11-19 10:07:16 +01:00
object_tree.rs Reduce SmolStr <-> &str conversions and copies (#6688) 2024-11-19 10:07:16 +01:00
parser.rs Use SmolStr in more places of the compiler infrastructure 2024-10-17 18:04:58 +02:00
passes.rs Reduce SmolStr <-> &str conversions and copies (#6688) 2024-11-19 10:07:16 +01:00
pathutils.rs Use SmolStr for parts of pathutils to remove temporary allocations 2024-10-17 18:04:58 +02:00
README.md Simplify commercial license (#3063) 2024-05-31 14:06:17 +02:00
typeloader.rs LSP: record dependencies and invalid all dependents when a dependencies changes 2024-11-14 14:35:22 +01:00
typeregister.rs LSP: Signature Help 2024-11-06 13:27:29 +01:00

The Slint Compiler Library

NOTE: This library is an internal crate of the Slint project. This crate should not be used directly by applications using Slint. You should use the slint crate instead.

WARNING: This crate does not follow the semver convention for versioning and can only be used with version = "=x.y.z" in Cargo.toml.