-
-
Notifications
You must be signed in to change notification settings - Fork 146
feat!: apply task id optimization #858
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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
numbertostringacross 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() {
Benchmarks Results
Node: 20 "queue/array"
18554
"queue/fixed"
18045
"simple/async/default"
17553
"simple/async/customized"
17298
"simple/default"
18322
"simple/customized"
18575MAIN: "queue/array"
20288
"queue/fixed"
20700
"simple/async/default"
17350
"simple/async/customized"
18904
"simple/default"
18739
"simple/customized"
17941Node: 22 "queue/array"
16461
"queue/fixed"
17675
"simple/async/default"
17037
"simple/async/customized"
18620
"simple/default"
18676
"simple/customized"
17263MAIN: "queue/array"
19859
"queue/fixed"
20254
"simple/async/default"
17797
"simple/async/customized"
18904
"simple/default"
19463
"simple/customized"
17387Node: 24 "queue/array"
16042
"queue/fixed"
17154
"simple/async/default"
17463
"simple/async/customized"
18516
"simple/default"
19185
"simple/customized"
21378MAIN: "queue/array"
17736
"queue/fixed"
18350
"simple/async/default"
17697
"simple/async/customized"
17416
"simple/default"
19212
"simple/customized"
19984 |
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]>
Benchmarks Results
Node: 20 "queue/array"
18811
"queue/fixed"
19412
"simple/async/default"
17333
"simple/async/customized"
17069
"simple/default"
18020
"simple/customized"
17877MAIN: "queue/array"
19743
"queue/fixed"
19530
"simple/async/default"
19043
"simple/async/customized"
16962
"simple/default"
17845
"simple/customized"
16899Node: 22 "queue/array"
20069
"queue/fixed"
19953
"simple/async/default"
18045
"simple/async/customized"
19066
"simple/default"
20860
"simple/customized"
20086MAIN: "queue/array"
19009
"queue/fixed"
19040
"simple/async/default"
19766
"simple/async/customized"
18859
"simple/default"
18403
"simple/customized"
19956Node: 24 "queue/array"
17321
"queue/fixed"
18142
"simple/async/default"
19309
"simple/async/customized"
18692
"simple/default"
19572
"simple/customized"
17549MAIN: "queue/array"
17595
"queue/fixed"
18937
"simple/async/default"
17417
"simple/async/customized"
16346
"simple/default"
17715
"simple/customized"
19460 |
Benchmarks Results
Node: 20 "queue/array"
18964
"queue/fixed"
20316
"simple/async/default"
17018
"simple/async/customized"
17327
"simple/default"
18029
"simple/customized"
18573MAIN: "queue/array"
18348
"queue/fixed"
17904
"simple/async/default"
15929
"simple/async/customized"
16996
"simple/default"
17529
"simple/customized"
17661Node: 22 "queue/array"
17331
"queue/fixed"
17978
"simple/async/default"
17210
"simple/async/customized"
17065
"simple/default"
17593
"simple/customized"
18104MAIN: "queue/array"
20814
"queue/fixed"
19094
"simple/async/default"
19688
"simple/async/customized"
20267
"simple/default"
18659
"simple/customized"
18152Node: 24 "queue/array"
19932
"queue/fixed"
17955
"simple/async/default"
18013
"simple/async/customized"
18795
"simple/default"
18388
"simple/customized"
18471MAIN: "queue/array"
16984
"queue/fixed"
18548
"simple/async/default"
16707
"simple/async/customized"
16700
"simple/default"
18685
"simple/customized"
20518 |
No description provided.