Skip to content

Commit

Permalink
ensure that the v2 bundler uses the WorkPool's threadpool
Browse files Browse the repository at this point in the history
  • Loading branch information
brainkim committed Dec 26, 2024
1 parent a57cf47 commit 3dd728a
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions src/bundler/bundle_v2.zig
Original file line number Diff line number Diff line change
Expand Up @@ -153,20 +153,8 @@ pub const ThreadPool = struct {

pub fn start(this: *ThreadPool, v2: *BundleV2, existing_thread_pool: ?*ThreadPoolLib) !void {
this.v2 = v2;

if (existing_thread_pool) |pool| {
this.pool = pool;
} else {
const cpu_count = bun.getThreadCount();
this.pool = try v2.graph.allocator.create(ThreadPoolLib);
this.pool.* = ThreadPoolLib.init(.{
.max_threads = cpu_count,
});
debug("{d} workers", .{cpu_count});
}

this.pool = existing_thread_pool orelse JSC.WorkPool.get();
this.pool.warm(8);

this.pool.setThreadContext(this);
}

Expand Down

0 comments on commit 3dd728a

Please sign in to comment.