Skip to content

Conversation

@metcoder95
Copy link
Member

No description provided.

@metcoder95 metcoder95 requested a review from Copilot July 24, 2025 09:33
@metcoder95 metcoder95 added the benchmarks Run benchmarks on PRs label Jul 24, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a task ID optimization by changing task identifiers from numeric to string format. The change involves converting task IDs to base-36 strings and implementing a custom task ID factory with counter overflow protection.

  • Changed task ID type from number to string across all interfaces and classes
  • Implemented a new taskIdFactory() function that generates base-36 string IDs with overflow protection
  • Updated TaskInfo class to use static method for ID generation instead of global counter

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
src/types.ts Updated RequestMessage and ResponseMessage interfaces to use string taskId
src/worker_pool/index.ts Modified WorkerInfo class to handle string-based task IDs
src/task_queue/index.ts Implemented new task ID factory and updated TaskInfo class
src/task_queue/common.ts Updated PiscinaTask interface to use string taskId
Comments suppressed due to low confidence (1)

src/task_queue/index.ts:45

  • [nitpick] The function name 'taskIdFactory' should follow camelCase convention and be more descriptive. Consider renaming to 'createTaskIdGenerator' to better reflect that it returns a generator function.
function taskIdFactory() {

@github-actions
Copy link

Benchmarks Results

Numbers are in Ops/sec

Node: 20
PR:

"queue/array"
18554
"queue/fixed"
18045
"simple/async/default"
17553
"simple/async/customized"
17298
"simple/default"
18322
"simple/customized"
18575

MAIN:

"queue/array"
20288
"queue/fixed"
20700
"simple/async/default"
17350
"simple/async/customized"
18904
"simple/default"
18739
"simple/customized"
17941

Node: 22
PR:

"queue/array"
16461
"queue/fixed"
17675
"simple/async/default"
17037
"simple/async/customized"
18620
"simple/default"
18676
"simple/customized"
17263

MAIN:

"queue/array"
19859
"queue/fixed"
20254
"simple/async/default"
17797
"simple/async/customized"
18904
"simple/default"
19463
"simple/customized"
17387

Node: 24
PR:

"queue/array"
16042
"queue/fixed"
17154
"simple/async/default"
17463
"simple/async/customized"
18516
"simple/default"
19185
"simple/customized"
21378

MAIN:

"queue/array"
17736
"queue/fixed"
18350
"simple/async/default"
17697
"simple/async/customized"
17416
"simple/default"
19212
"simple/customized"
19984

@github-actions github-actions bot removed the benchmarks Run benchmarks on PRs label Jul 24, 2025
metcoder95 and others added 2 commits July 24, 2025 12:48
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Carlos Fuentes <[email protected]>
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Carlos Fuentes <[email protected]>
@metcoder95 metcoder95 added the benchmarks Run benchmarks on PRs label Jul 24, 2025
@github-actions
Copy link

Benchmarks Results

Numbers are in Ops/sec

Node: 20
PR:

"queue/array"
18811
"queue/fixed"
19412
"simple/async/default"
17333
"simple/async/customized"
17069
"simple/default"
18020
"simple/customized"
17877

MAIN:

"queue/array"
19743
"queue/fixed"
19530
"simple/async/default"
19043
"simple/async/customized"
16962
"simple/default"
17845
"simple/customized"
16899

Node: 22
PR:

"queue/array"
20069
"queue/fixed"
19953
"simple/async/default"
18045
"simple/async/customized"
19066
"simple/default"
20860
"simple/customized"
20086

MAIN:

"queue/array"
19009
"queue/fixed"
19040
"simple/async/default"
19766
"simple/async/customized"
18859
"simple/default"
18403
"simple/customized"
19956

Node: 24
PR:

"queue/array"
17321
"queue/fixed"
18142
"simple/async/default"
19309
"simple/async/customized"
18692
"simple/default"
19572
"simple/customized"
17549

MAIN:

"queue/array"
17595
"queue/fixed"
18937
"simple/async/default"
17417
"simple/async/customized"
16346
"simple/default"
17715
"simple/customized"
19460

@github-actions github-actions bot removed the benchmarks Run benchmarks on PRs label Jul 24, 2025
@metcoder95 metcoder95 added backport v4 Backport work label related with v4.x benchmarks Run benchmarks on PRs and removed backport v4 Backport work label related with v4.x labels Jul 27, 2025
@github-actions
Copy link

Benchmarks Results

Numbers are in Ops/sec

Node: 20
PR:

"queue/array"
18964
"queue/fixed"
20316
"simple/async/default"
17018
"simple/async/customized"
17327
"simple/default"
18029
"simple/customized"
18573

MAIN:

"queue/array"
18348
"queue/fixed"
17904
"simple/async/default"
15929
"simple/async/customized"
16996
"simple/default"
17529
"simple/customized"
17661

Node: 22
PR:

"queue/array"
17331
"queue/fixed"
17978
"simple/async/default"
17210
"simple/async/customized"
17065
"simple/default"
17593
"simple/customized"
18104

MAIN:

"queue/array"
20814
"queue/fixed"
19094
"simple/async/default"
19688
"simple/async/customized"
20267
"simple/default"
18659
"simple/customized"
18152

Node: 24
PR:

"queue/array"
19932
"queue/fixed"
17955
"simple/async/default"
18013
"simple/async/customized"
18795
"simple/default"
18388
"simple/customized"
18471

MAIN:

"queue/array"
16984
"queue/fixed"
18548
"simple/async/default"
16707
"simple/async/customized"
16700
"simple/default"
18685
"simple/customized"
20518

@github-actions github-actions bot removed the benchmarks Run benchmarks on PRs label Jul 27, 2025
@metcoder95 metcoder95 merged commit e3e2d39 into current Jul 27, 2025
13 of 14 checks passed
@metcoder95 metcoder95 deleted the refactor-task-id branch July 27, 2025 10:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants