mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-29 12:54:22 +01:00
Merge 'Add jsonb bench and rewrite jsonb parser to use slice and cursor' from Ihor Andrianov
Added bench to see how far i am from SQLite. If ~~Cloude~~ I did benches correct moving from iterator to slice and cursor gives crazy performance bump where we are almost on par with SLQLite when we are not talking about huge jsons, but i suspect SQLite do some trickery there. Closes #1125
This commit is contained in:
@@ -108,3 +108,7 @@ harness = false
|
||||
[[bench]]
|
||||
name = "mvcc_benchmark"
|
||||
harness = false
|
||||
|
||||
[[bench]]
|
||||
name = "json_benchmark"
|
||||
harness = false
|
||||
|
||||
493
core/benches/json_benchmark.rs
Normal file
493
core/benches/json_benchmark.rs
Normal file
File diff suppressed because one or more lines are too long
1181
core/json/jsonb.rs
1181
core/json/jsonb.rs
File diff suppressed because it is too large
Load Diff
@@ -75,7 +75,7 @@ pub fn get_json(json_value: &OwnedValue, indent: Option<&str>) -> crate::Result<
|
||||
pub fn jsonb(json_value: &OwnedValue) -> crate::Result<OwnedValue> {
|
||||
let jsonbin = match json_value {
|
||||
OwnedValue::Null | OwnedValue::Integer(_) | OwnedValue::Float(_) | OwnedValue::Text(_) => {
|
||||
Jsonb::from_str(&json_value.to_string())
|
||||
Jsonb::from_str(&json_value.to_text().unwrap())
|
||||
}
|
||||
OwnedValue::Blob(blob) => {
|
||||
let blob = Jsonb::new(blob.len(), Some(&blob));
|
||||
|
||||
Reference in New Issue
Block a user