fix beta build

This commit is contained in:
Skgland
2021-06-02 16:43:10 +02:00
parent 87ef3519d9
commit e08c302756
4 changed files with 69 additions and 101 deletions

58
Cargo.lock generated
View File

@@ -1,13 +1,12 @@
# This file is automatically @generated by Cargo. # This file is automatically @generated by Cargo.
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3
[[package]] [[package]]
name = "arrayvec" name = "arrayvec"
version = "0.4.12" version = "0.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cd9fd44efafa8690358b7408d253adf110036b88f55672a933f01d616ad9b1b9" checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
dependencies = [
"nodrop",
]
[[package]] [[package]]
name = "assert_cmd" name = "assert_cmd"
@@ -483,24 +482,23 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
[[package]] [[package]]
name = "lexical" name = "lexical"
version = "2.2.2" version = "5.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e0d09e60c187a6d0a3fa418aec8587c6a4ae9de872f6126f2134f319b5ed10d" checksum = "f404a90a744e32e8be729034fc33b90cf2a56418fbf594d69aa3c0214ad414e5"
dependencies = [ dependencies = [
"cfg-if 0.1.10", "cfg-if 1.0.0",
"lexical-core", "lexical-core",
"rustc_version",
] ]
[[package]] [[package]]
name = "lexical-core" name = "lexical-core"
version = "0.4.6" version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2304bccb228c4b020f3a4835d247df0a02a7c4686098d4167762cfbbe4c5cb14" checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe"
dependencies = [ dependencies = [
"arrayvec", "arrayvec",
"cfg-if 0.1.10", "bitflags",
"rustc_version", "cfg-if 1.0.0",
"ryu", "ryu",
"static_assertions", "static_assertions",
] ]
@@ -675,12 +673,6 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "nodrop"
version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb"
[[package]] [[package]]
name = "num-bigint" name = "num-bigint"
version = "0.2.6" version = "0.2.6"
@@ -1218,15 +1210,6 @@ dependencies = [
"libc", "libc",
] ]
[[package]]
name = "rustc_version"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
dependencies = [
"semver",
]
[[package]] [[package]]
name = "rustyline" name = "rustyline"
version = "7.1.0" version = "7.1.0"
@@ -1341,21 +1324,6 @@ dependencies = [
"html5ever", "html5ever",
] ]
[[package]]
name = "semver"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
dependencies = [
"semver-parser",
]
[[package]]
name = "semver-parser"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.123" version = "1.0.123"
@@ -1465,9 +1433,9 @@ checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d"
[[package]] [[package]]
name = "static_assertions" name = "static_assertions"
version = "0.3.4" version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f3eb36b47e512f8f1c9e3d10c2c1965bc992bd9cdb024fa581e2194501c83d3" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
[[package]] [[package]]
name = "string_cache" name = "string_cache"

View File

@@ -9,7 +9,7 @@ license = "BSD-3-Clause"
[dependencies] [dependencies]
indexmap = "1.0.2" indexmap = "1.0.2"
lexical = "2.1.0" lexical = "5.2.1"
ordered-float = "0.5.0" ordered-float = "0.5.0"
rug = { optional = true, version = "1.4.0" } rug = { optional = true, version = "1.4.0" }
num-rug-adapter = { optional = true, path = "../num-rug-adapter" } num-rug-adapter = { optional = true, path = "../num-rug-adapter" }

View File

@@ -555,7 +555,7 @@ impl<'a, R: Read> Lexer<'a, R> {
fn vacate_with_float(&mut self, mut token: String) -> Token { fn vacate_with_float(&mut self, mut token: String) -> Token {
self.return_char(token.pop().unwrap()); self.return_char(token.pop().unwrap());
let result = OrderedFloat(parse_lossy::<f64, _>(token.as_bytes())); let result = OrderedFloat(parse_lossy::<f64, _>(token.as_bytes()).unwrap());
Token::Constant(Constant::Float(result)) Token::Constant(Constant::Float(result))
} }
@@ -633,13 +633,13 @@ impl<'a, R: Read> Lexer<'a, R> {
token.push(self.skip_char()?); token.push(self.skip_char()?);
} }
let n = OrderedFloat(parse_lossy::<f64, _>(token.as_bytes())); let n = OrderedFloat(parse_lossy::<f64, _>(token.as_bytes()).unwrap());
Ok(Token::Constant(Constant::Float(n))) Ok(Token::Constant(Constant::Float(n)))
} else { } else {
return Ok(self.vacate_with_float(token)); return Ok(self.vacate_with_float(token));
} }
} else { } else {
let n = OrderedFloat(parse_lossy::<f64, _>(token.as_bytes())); let n = OrderedFloat(parse_lossy::<f64, _>(token.as_bytes()).unwrap());
Ok(Token::Constant(Constant::Float(n))) Ok(Token::Constant(Constant::Float(n)))
} }
} else { } else {

View File

@@ -1,52 +1,52 @@
## Benchmarks ## Benchmarks
These are honestly super flawed (single read/write of a single file) but that can at least capture movement on the These are honestly super flawed (single read/write of a single file) but that can at least capture movement on the
order of 0.1 s, and that's good enough for me. order of 0.1 s, and that's good enough for me.
### Read ### Read
With CLP(Z): With CLP(Z):
``` ```
?- test_json:test_json_read. ?- test_json:test_json_read.
% CPU time: 41.522 seconds % CPU time: 41.522 seconds
``` ```
After removing CLP(Z): After removing CLP(Z):
``` ```
?- test_json:test_json_read. ?- test_json:test_json_read.
% CPU time: 0.444 seconds % CPU time: 0.444 seconds
``` ```
With first argument indexing optimizations: With first argument indexing optimizations:
``` ```
?- test_json:test_json_read. ?- test_json:test_json_read.
% CPU time: 0.310 seconds % CPU time: 0.310 seconds
``` ```
After making the code more general: After making the code more general:
``` ```
?- test_json:test_json_read. ?- test_json:test_json_read.
% CPU time: 0.217 seconds % CPU time: 0.217 seconds
``` ```
### Write ### Write
Without first argument indexing optimizations: Without first argument indexing optimizations:
``` ```
?- test_json:test_json_minify. ?- test_json:test_json_minify.
% CPU time: 0.014 seconds % CPU time: 0.014 seconds
``` ```
With first argument indexing optimizations: With first argument indexing optimizations:
``` ```
?- test_json:test_json_minify. ?- test_json:test_json_minify.
% CPU time: 0.015 seconds % CPU time: 0.015 seconds
``` ```
After making the code more general: After making the code more general:
``` ```
?- test_json:test_json_minify. ?- test_json:test_json_minify.
% CPU time: 0.013 seconds % CPU time: 0.013 seconds
``` ```