difftreelog
Remove remainder of `codegenerated-stdlib`
in: master
2 files changed
crates/jrsonnet-evaluator/README.mddiffbeforeafterboth--- a/crates/jrsonnet-evaluator/README.md
+++ b/crates/jrsonnet-evaluator/README.md
@@ -8,12 +8,10 @@
- `serialized-stdlib`
- serializes standard library AST using serde
- - slower than `codegenerated-stdlib` at runtime, but have no compilation speed penality
+ - used by default
- none
- leaves only stdlib source code in binary, processing them same way as user supplied data
- slowest (as it involves parsing of standard library source code)
-
-Because of `codegenerated-stdlib` compilation slowdown, `serialized-stdlib` is used by default
### Benchmark
crates/jrsonnet-evaluator/src/builtin/stdlib.rsdiffbeforeafterboth1use jrsonnet_parser::{LocExpr, ParserSettings};2use std::path::PathBuf;34thread_local! {5 /// To avoid parsing again when issued from the same thread6 #[allow(unreachable_code)]7 static PARSED_STDLIB: LocExpr = {8 #[cfg(feature = "serialized-stdlib")]9 {10 // Should not panic, stdlib.bincode is generated in build.rs11 return bincode::deserialize(include_bytes!(concat!(env!("OUT_DIR"), "/stdlib.bincode")))12 .unwrap();13 }1415 jrsonnet_parser::parse(16 jrsonnet_stdlib::STDLIB_STR,17 &ParserSettings {18 loc_data: true,19 file_name: PathBuf::from("std.jsonnet").into(),20 },21 )22 .unwrap()23 }24}2526pub fn get_parsed_stdlib() -> LocExpr {27 PARSED_STDLIB.with(|t| t.clone())28}