Skip to content

Commit

Permalink
chore(ids): drop uuid dependency which has a performance penalty and …
Browse files Browse the repository at this point in the history
…use internal counter
  • Loading branch information
yamafaktory committed Sep 13, 2024
1 parent fb81fb3 commit e06862c
Show file tree
Hide file tree
Showing 4 changed files with 163 additions and 168 deletions.
9 changes: 0 additions & 9 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,4 @@ pub fn build(b: *std.Build) void {
}
bench_step.dependOn(&bench_run.step);
b.default_step.dependOn(bench_step);

if (b.lazyDependency("uuid", .{
.target = target,
.optimize = optimize,
})) |dep| {
unit_tests.root_module.addImport("uuid", dep.module("uuid"));
check.root_module.addImport("uuid", dep.module("uuid"));
bench_exe.root_module.addImport("uuid", dep.module("uuid"));
}
}
6 changes: 0 additions & 6 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
.name = "hypergraphz",
.version = "0.0.1",
.minimum_zig_version = "0.13.0",
.dependencies = .{
.uuid = .{
.url = "https://github.com/r4gus/uuid-zig/archive/refs/tags/0.2.1.tar.gz",
.hash = "1220b4deeb4ec1ec3493ea934905356384561b725dba69d1fbf6a25cb398716dd05b",
},
},
.paths = .{
"LICENSE",
"README.md",
Expand Down
5 changes: 2 additions & 3 deletions src/bench.zig
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
//! Benchmarks for HypergraphZ.

const std = @import("std");
const uuid = @import("uuid");
const hypergraphz = @import("hypergraphz.zig");

const Allocator = std.mem.Allocator;
const ArrayList = std.ArrayList;
const GeneralPurposeAllocator = std.heap.GeneralPurposeAllocator;
const HypergraphZ = hypergraphz.HypergraphZ;
const HypergraphZId = hypergraphz.HypergraphZId;
const Timer = std.time.Timer;
const Uuid = uuid.Uuid;
const comptimePrint = std.fmt.comptimePrint;
const fmtDuration = std.fmt.fmtDuration;
const getStdOut = std.io.getStdOut;
Expand Down Expand Up @@ -66,7 +65,7 @@ pub fn main() !void {
}

{
var vertices = try ArrayList(Uuid).initCapacity(allocator, 1_000);
var vertices = try ArrayList(HypergraphZId).initCapacity(allocator, 1_000);
defer vertices.deinit();
var bench = try Bench.init(allocator, stdout, "generate 1_000 hyperedges with 1_000 vertices each in batches");
for (0..1_000) |_| {
Expand Down
Loading

0 comments on commit e06862c

Please sign in to comment.