mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-01 07:24:19 +01:00
fmt
This commit is contained in:
@@ -24,13 +24,7 @@ fn bench_open(criterion: &mut Criterion) {
|
||||
if !std::fs::exists("../testing/schema_5k.db").unwrap() {
|
||||
#[allow(clippy::arc_with_non_send_sync)]
|
||||
let io = Arc::new(PlatformIO::new().unwrap());
|
||||
let db = Database::open_file(
|
||||
io.clone(),
|
||||
"../testing/schema_5k.db",
|
||||
false,
|
||||
false,
|
||||
)
|
||||
.unwrap();
|
||||
let db = Database::open_file(io.clone(), "../testing/schema_5k.db", false, false).unwrap();
|
||||
let conn = db.connect().unwrap();
|
||||
|
||||
for i in 0..5000 {
|
||||
@@ -46,13 +40,8 @@ fn bench_open(criterion: &mut Criterion) {
|
||||
b.iter(|| {
|
||||
#[allow(clippy::arc_with_non_send_sync)]
|
||||
let io = Arc::new(PlatformIO::new().unwrap());
|
||||
let db = Database::open_file(
|
||||
io.clone(),
|
||||
"../testing/schema_5k.db",
|
||||
false,
|
||||
false,
|
||||
)
|
||||
.unwrap();
|
||||
let db =
|
||||
Database::open_file(io.clone(), "../testing/schema_5k.db", false, false).unwrap();
|
||||
let conn = db.connect().unwrap();
|
||||
conn.execute("SELECT * FROM table_0").unwrap();
|
||||
});
|
||||
@@ -78,13 +67,7 @@ fn bench_alter(criterion: &mut Criterion) {
|
||||
if !std::fs::exists("../testing/schema_5k.db").unwrap() {
|
||||
#[allow(clippy::arc_with_non_send_sync)]
|
||||
let io = Arc::new(PlatformIO::new().unwrap());
|
||||
let db = Database::open_file(
|
||||
io.clone(),
|
||||
"../testing/schema_5k.db",
|
||||
false,
|
||||
false,
|
||||
)
|
||||
.unwrap();
|
||||
let db = Database::open_file(io.clone(), "../testing/schema_5k.db", false, false).unwrap();
|
||||
let conn = db.connect().unwrap();
|
||||
|
||||
for i in 0..5000 {
|
||||
@@ -99,13 +82,7 @@ fn bench_alter(criterion: &mut Criterion) {
|
||||
group.bench_function(BenchmarkId::new("limbo_rename_table", ""), |b| {
|
||||
#[allow(clippy::arc_with_non_send_sync)]
|
||||
let io = Arc::new(PlatformIO::new().unwrap());
|
||||
let db = Database::open_file(
|
||||
io.clone(),
|
||||
"../testing/schema_5k.db",
|
||||
false,
|
||||
false,
|
||||
)
|
||||
.unwrap();
|
||||
let db = Database::open_file(io.clone(), "../testing/schema_5k.db", false, false).unwrap();
|
||||
let conn = db.connect().unwrap();
|
||||
b.iter_custom(|iters| {
|
||||
(0..iters)
|
||||
@@ -150,13 +127,7 @@ fn bench_alter(criterion: &mut Criterion) {
|
||||
group.bench_function(BenchmarkId::new("limbo_rename_column", ""), |b| {
|
||||
#[allow(clippy::arc_with_non_send_sync)]
|
||||
let io = Arc::new(PlatformIO::new().unwrap());
|
||||
let db = Database::open_file(
|
||||
io.clone(),
|
||||
"../testing/schema_5k.db",
|
||||
false,
|
||||
false,
|
||||
)
|
||||
.unwrap();
|
||||
let db = Database::open_file(io.clone(), "../testing/schema_5k.db", false, false).unwrap();
|
||||
let conn = db.connect().unwrap();
|
||||
b.iter_custom(|iters| {
|
||||
(0..iters)
|
||||
@@ -202,13 +173,7 @@ fn bench_alter(criterion: &mut Criterion) {
|
||||
group.bench_function(BenchmarkId::new("limbo_add_column", ""), |b| {
|
||||
#[allow(clippy::arc_with_non_send_sync)]
|
||||
let io = Arc::new(PlatformIO::new().unwrap());
|
||||
let db = Database::open_file(
|
||||
io.clone(),
|
||||
"../testing/schema_5k.db",
|
||||
false,
|
||||
false,
|
||||
)
|
||||
.unwrap();
|
||||
let db = Database::open_file(io.clone(), "../testing/schema_5k.db", false, false).unwrap();
|
||||
let conn = db.connect().unwrap();
|
||||
b.iter_custom(|iters| {
|
||||
(0..iters)
|
||||
@@ -253,13 +218,7 @@ fn bench_alter(criterion: &mut Criterion) {
|
||||
group.bench_function(BenchmarkId::new("limbo_drop_column", ""), |b| {
|
||||
#[allow(clippy::arc_with_non_send_sync)]
|
||||
let io = Arc::new(PlatformIO::new().unwrap());
|
||||
let db = Database::open_file(
|
||||
io.clone(),
|
||||
"../testing/schema_5k.db",
|
||||
false,
|
||||
false,
|
||||
)
|
||||
.unwrap();
|
||||
let db = Database::open_file(io.clone(), "../testing/schema_5k.db", false, false).unwrap();
|
||||
let conn = db.connect().unwrap();
|
||||
b.iter_custom(|iters| {
|
||||
(0..iters)
|
||||
@@ -307,13 +266,7 @@ fn bench_prepare_query(criterion: &mut Criterion) {
|
||||
|
||||
#[allow(clippy::arc_with_non_send_sync)]
|
||||
let io = Arc::new(PlatformIO::new().unwrap());
|
||||
let db = Database::open_file(
|
||||
io.clone(),
|
||||
"../testing/testing.db",
|
||||
false,
|
||||
false,
|
||||
)
|
||||
.unwrap();
|
||||
let db = Database::open_file(io.clone(), "../testing/testing.db", false, false).unwrap();
|
||||
let limbo_conn = db.connect().unwrap();
|
||||
|
||||
let queries = [
|
||||
@@ -392,13 +345,7 @@ fn bench_execute_select_rows(criterion: &mut Criterion) {
|
||||
|
||||
#[allow(clippy::arc_with_non_send_sync)]
|
||||
let io = Arc::new(PlatformIO::new().unwrap());
|
||||
let db = Database::open_file(
|
||||
io.clone(),
|
||||
"../testing/testing.db",
|
||||
false,
|
||||
false,
|
||||
)
|
||||
.unwrap();
|
||||
let db = Database::open_file(io.clone(), "../testing/testing.db", false, false).unwrap();
|
||||
let limbo_conn = db.connect().unwrap();
|
||||
|
||||
let mut group = criterion.benchmark_group("Execute `SELECT * FROM users LIMIT ?`");
|
||||
@@ -466,13 +413,7 @@ fn bench_execute_select_1(criterion: &mut Criterion) {
|
||||
|
||||
#[allow(clippy::arc_with_non_send_sync)]
|
||||
let io = Arc::new(PlatformIO::new().unwrap());
|
||||
let db = Database::open_file(
|
||||
io.clone(),
|
||||
"../testing/testing.db",
|
||||
false,
|
||||
false,
|
||||
)
|
||||
.unwrap();
|
||||
let db = Database::open_file(io.clone(), "../testing/testing.db", false, false).unwrap();
|
||||
let limbo_conn = db.connect().unwrap();
|
||||
|
||||
let mut group = criterion.benchmark_group("Execute `SELECT 1`");
|
||||
@@ -524,13 +465,7 @@ fn bench_execute_select_count(criterion: &mut Criterion) {
|
||||
|
||||
#[allow(clippy::arc_with_non_send_sync)]
|
||||
let io = Arc::new(PlatformIO::new().unwrap());
|
||||
let db = Database::open_file(
|
||||
io.clone(),
|
||||
"../testing/testing.db",
|
||||
false,
|
||||
false,
|
||||
)
|
||||
.unwrap();
|
||||
let db = Database::open_file(io.clone(), "../testing/testing.db", false, false).unwrap();
|
||||
let limbo_conn = db.connect().unwrap();
|
||||
|
||||
let mut group = criterion.benchmark_group("Execute `SELECT count() FROM users`");
|
||||
@@ -588,13 +523,7 @@ fn bench_insert_rows(criterion: &mut Criterion) {
|
||||
|
||||
#[allow(clippy::arc_with_non_send_sync)]
|
||||
let io = Arc::new(PlatformIO::new().unwrap());
|
||||
let db = Database::open_file(
|
||||
io.clone(),
|
||||
db_path.to_str().unwrap(),
|
||||
false,
|
||||
false,
|
||||
)
|
||||
.unwrap();
|
||||
let db = Database::open_file(io.clone(), db_path.to_str().unwrap(), false, false).unwrap();
|
||||
let limbo_conn = db.connect().unwrap();
|
||||
|
||||
let mut stmt = limbo_conn
|
||||
@@ -718,13 +647,7 @@ fn bench_limbo(
|
||||
let io = Arc::new(PlatformIO::new().unwrap());
|
||||
let temp_dir = tempfile::tempdir().unwrap();
|
||||
let path = temp_dir.path().join("bench.db");
|
||||
let db = Database::open_file(
|
||||
io.clone(),
|
||||
path.to_str().unwrap(),
|
||||
mvcc,
|
||||
false,
|
||||
)
|
||||
.unwrap();
|
||||
let db = Database::open_file(io.clone(), path.to_str().unwrap(), mvcc, false).unwrap();
|
||||
let mut connecitons = Vec::new();
|
||||
{
|
||||
let conn = db.connect().unwrap();
|
||||
@@ -807,13 +730,7 @@ fn bench_limbo_mvcc(
|
||||
let io = Arc::new(PlatformIO::new().unwrap());
|
||||
let temp_dir = tempfile::tempdir().unwrap();
|
||||
let path = temp_dir.path().join("bench.db");
|
||||
let db = Database::open_file(
|
||||
io.clone(),
|
||||
path.to_str().unwrap(),
|
||||
mvcc,
|
||||
false,
|
||||
)
|
||||
.unwrap();
|
||||
let db = Database::open_file(io.clone(), path.to_str().unwrap(), mvcc, false).unwrap();
|
||||
let mut connecitons = Vec::new();
|
||||
let conn0 = db.connect().unwrap();
|
||||
conn0.execute("CREATE TABLE test (x)").unwrap();
|
||||
|
||||
@@ -490,13 +490,7 @@ fn bench_sequential_jsonb(criterion: &mut Criterion) {
|
||||
|
||||
#[allow(clippy::arc_with_non_send_sync)]
|
||||
let io = Arc::new(PlatformIO::new().unwrap());
|
||||
let db = Database::open_file(
|
||||
io.clone(),
|
||||
"../testing/testing.db",
|
||||
false,
|
||||
false,
|
||||
)
|
||||
.unwrap();
|
||||
let db = Database::open_file(io.clone(), "../testing/testing.db", false, false).unwrap();
|
||||
let limbo_conn = db.connect().unwrap();
|
||||
|
||||
// Select a subset of JSON payloads to use in the sequential test
|
||||
@@ -652,13 +646,7 @@ fn bench_json_patch(criterion: &mut Criterion) {
|
||||
|
||||
#[allow(clippy::arc_with_non_send_sync)]
|
||||
let io = Arc::new(PlatformIO::new().unwrap());
|
||||
let db = Database::open_file(
|
||||
io.clone(),
|
||||
"../testing/testing.db",
|
||||
false,
|
||||
false,
|
||||
)
|
||||
.unwrap();
|
||||
let db = Database::open_file(io.clone(), "../testing/testing.db", false, false).unwrap();
|
||||
let limbo_conn = db.connect().unwrap();
|
||||
|
||||
let json_patch_cases = [
|
||||
|
||||
Reference in New Issue
Block a user