git.delta.rocks / jrsonnet / refs/commits / fbae06992f5c

difftreelog

Merge pull request #54 from messense/rm-codegenereated-stdlib-ref

Yaroslav Bolyukin2021-07-13parents: #b6223e5 #bf70e2e.patch.diff
in: master
Remove remainder of `codegenerated-stdlib`

2 files changed

modifiedcrates/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
 
modifiedcrates/jrsonnet-evaluator/src/builtin/stdlib.rsdiffbeforeafterboth
before · crates/jrsonnet-evaluator/src/builtin/stdlib.rs
1use 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 = "codegenerated-stdlib")]9		{10			#[allow(clippy::all)]11			return {12				use jrsonnet_parser::*;13				include!(concat!(env!("OUT_DIR"), "/stdlib.rs"))14			};15		}1617		#[cfg(feature = "serialized-stdlib")]18		{19			// Should not panic, stdlib.bincode is generated in build.rs20			return bincode::deserialize(include_bytes!(concat!(env!("OUT_DIR"), "/stdlib.bincode")))21				.unwrap();22		}2324		jrsonnet_parser::parse(25			jrsonnet_stdlib::STDLIB_STR,26			&ParserSettings {27				loc_data: true,28				file_name: PathBuf::from("std.jsonnet").into(),29			},30		)31		.unwrap()32	}33}3435pub fn get_parsed_stdlib() -> LocExpr {36	PARSED_STDLIB.with(|t| t.clone())37}