Skip to content

Conversation

@jerome-benoit
Copy link
Collaborator

  • avoid memory leak
  • trigger the GC less often

closes #365

+ avoid memory leak
+ trigger the GC less often

closes tinylibs#365

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
@jerome-benoit jerome-benoit self-assigned this Nov 2, 2025
Copilot AI review requested due to automatic review settings November 2, 2025 21:20
@jerome-benoit jerome-benoit added the bug Something isn't working label Nov 2, 2025
@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 2, 2025

Open in StackBlitz

npm i https://pkg.pr.new/tinylibs/tinybench@386

commit: 7fde4d9

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>

This comment was marked as outdated.

Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
@jerome-benoit jerome-benoit changed the title fix: replace plimit with own promises limiter implementation fix: replace plimit with own promises limiter implementation to plug mem leak Nov 2, 2025
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
- Standardize naming to pattern: [prefix-technique] [core-functionality] [(async/sync)]
- Convert verbose descriptions to concise technical format
- Update 32 test descriptions across 8 files for consistency
- Improve code readability and maintainability
- All tests continue to pass (104 passing, 1 skipped)
@jerome-benoit jerome-benoit marked this pull request as draft November 3, 2025 08:55
@jerome-benoit
Copy link
Collaborator Author

The current approach keeping the p-limit 'stream' API is inherently racy at task abortion handling.

@Uzlopak Uzlopak requested a review from Copilot November 6, 2025 02:09

This comment was marked as outdated.

src/utils.ts Outdated
}

const worker = async () => {
while (!finished) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the caller is blocked until there's a room to proceed the next. I think it's fine for tinybench usage and avoid the usage of intermediate mechanism to store internally the work left.

@Uzlopak Uzlopak marked this pull request as ready for review November 9, 2025 20:32
@Uzlopak Uzlopak merged commit 6d93a1e into tinylibs:main Nov 10, 2025
35 checks passed
@jerome-benoit jerome-benoit deleted the fix/concurrency branch December 7, 2025 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace p-limit with own implementation

3 participants