-
Notifications
You must be signed in to change notification settings - Fork 79
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: improve switch performance (#159)
* fix: improve switch performance * fix pipeline
- Loading branch information
1 parent
d0ec9a1
commit 2d1beba
Showing
11 changed files
with
2,170 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
*.node | ||
*.node | ||
*.internal.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
use napi_derive::napi; | ||
use std::sync::atomic::Ordering; | ||
use zen_engine::ZEN_CONFIG; | ||
|
||
#[napi(object)] | ||
pub struct ZenConfig { | ||
pub nodes_in_context: Option<bool>, | ||
} | ||
|
||
#[allow(dead_code)] | ||
#[napi] | ||
pub fn override_config(config: ZenConfig) { | ||
if let Some(val) = config.nodes_in_context { | ||
ZEN_CONFIG.nodes_in_context.store(val, Ordering::Relaxed) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
mod config; | ||
mod content; | ||
mod custom_node; | ||
mod decision; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
use once_cell::sync::Lazy; | ||
use std::sync::atomic::AtomicBool; | ||
|
||
#[derive(Debug)] | ||
pub struct ZenConfig { | ||
pub nodes_in_context: AtomicBool, | ||
} | ||
|
||
impl Default for ZenConfig { | ||
fn default() -> Self { | ||
Self { | ||
nodes_in_context: AtomicBool::new(true), | ||
} | ||
} | ||
} | ||
|
||
pub static ZEN_CONFIG: Lazy<ZenConfig> = Lazy::new(|| Default::default()); |
Oops, something went wrong.