Skip to content

Commit 1c77f4a

Browse files
jkelleyrtperichulburd
authored andcommitted
Enable interning for strings on the JS/RS boundary
1 parent 03e39e4 commit 1c77f4a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

frameworks/keyed/dioxus/src/main.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@ use dioxus::prelude::*;
44
use rand::prelude::*;
55

66
fn main() {
7+
// for performance reasons, we want to cache these strings on the edge of js/rust boundary
8+
for &name in ADJECTIVES
9+
.iter()
10+
.chain(NOUNS.iter())
11+
.chain(COLOURS.iter())
12+
.chain(OTHER.iter())
13+
{
14+
wasm_bindgen::intern(name);
15+
}
16+
717
dioxus::web::launch(app);
818
}
919

0 commit comments

Comments
 (0)