Skip to content

Conversation

@claneo
Copy link
Collaborator

@claneo claneo commented Dec 23, 2025

Requires tinylibs/tinypool#128 to be merged.

Summary

Problem

When sending large files to worker, json serialization cost too much time.

image

It will even throw an error when the message is larger.

node:buffer:1154
      data[i] = this[i];
              ^

RangeError: Invalid array length
    at Uint8Array.toJSON (node:buffer:1154:15)
    at stringify (<anonymous>)
    at writeChannelMessage (node:internal/child_process/serialization:164:20)
    at target._send (node:internal/child_process:851:17)
    at target.send (node:internal/child_process:751:19)
    at ProcessWorker.send (file:///project/node_modules/.pnpm/tinypool@1.1.1/node_modules/tinypool/dist/index.js:140:41)
    at EventEmitter.<anonymous> (file:///project/node_modules/.pnpm/tinypool@1.1.1/node_modules/tinypool/dist/index.js:136:9)
    at EventEmitter.emit (node:events:519:28)
    at post (file:///project/node_modules/.pnpm/@rstest+core@0.7.4_patch_hash=2ca3ffb9c737907cda764b112b1056468ffdef8a8e3d1652736072afc_3e469dd1c273e9c5e41855799fa57aa8/node_modules/@rstest/core/dist/0%7E89.js:45:21)
    at EventEmitter.onMessage (file:///project/node_modules/.pnpm/@rstest+core@0.7.4_patch_hash=2ca3ffb9c737907cda764b112b1056468ffdef8a8e3d1652736072afc_3e469dd1c273e9c5e41855799fa57aa8/node_modules/@rstest/core/dist/216.js:155:27)

After switching to advanced serialization, the duration has significantly decreased.

image

Breaking changes

tinypool v2.0.0 dropped Node 18 support.

Changes

  • Update tinypool to v2.1.0
  • Set serialization to 'advanced'
  • Remove all manual serialization

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

@netlify
Copy link

netlify bot commented Dec 23, 2025

Deploy Preview for rstest-dev ready!

Name Link
🔨 Latest commit 8a85aa5
🔍 Latest deploy log https://app.netlify.com/projects/rstest-dev/deploys/6949feb50ef6810008241403
😎 Deploy Preview https://deploy-preview-792--rstest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@9aoy
Copy link
Collaborator

9aoy commented Dec 23, 2025

Rstest will drop Node 18 support in Rspack v2.0. Before that, a preview version can be released if needed.
web-infra-dev/rspack#9270

@claneo
Copy link
Collaborator Author

claneo commented Dec 23, 2025

a preview version can be released if needed

Which one do you mean? rstest or rspack?

@9aoy
Copy link
Collaborator

9aoy commented Dec 23, 2025

Which one do you mean? rstest or rspack?

Rstest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants