Skip to content

Commit

Permalink
fix disk path benchmark v2
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNineteen committed Jun 5, 2024
1 parent d52deb0 commit a88cbe1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/accountsdb/db.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1372,12 +1372,15 @@ pub const BenchmarkAccountsDB = struct {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
var allocator = gpa.allocator();

const disk_path = "test_data/tmp/";
std.fs.cwd().makeDir(disk_path) catch {};

const logger = Logger{ .noop = {} };
var accounts_db: AccountsDB = undefined;
if (bench_args.index == .disk) {
// std.debug.print("using disk index\n", .{});
accounts_db = try AccountsDB.init(allocator, logger, .{
.disk_index_path = "test_data/tmp/tmp",
.disk_index_path = disk_path ++ "tmp",
});
} else {
// std.debug.print("using ram index\n", .{});
Expand Down Expand Up @@ -1447,8 +1450,6 @@ pub const BenchmarkAccountsDB = struct {
);
}
const aligned_size = std.mem.alignForward(usize, size, std.mem.page_size);
const disk_path = "test_data/tmp/";
try std.fs.cwd().makeDir(disk_path);
const filepath = try std.fmt.allocPrint(allocator, disk_path ++ "slot{d}.bin", .{s});

const length = blk: {
Expand Down

0 comments on commit a88cbe1

Please sign in to comment.