Skip to content

SerialPort on Node v20 incurs high CPU load. #2659

@mousseq

Description

@mousseq

SerialPort Version

8.0.2

Node Version

20.4.0

Electron Version

No response

Platform

Linux pi4-1 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux

Architecture

Raspberry Pi 4 (ARM)

Hardware or chipset of serialport

FTDI

What steps will reproduce the bug?

The enclosed program opens three serial ports and reads from them (and does nothing with the data). The ports receive data at relatively modest rates (1000 bytes 30 times a second).

What happens?

When built and run with Node v19.8.1, the CPU load is negligible. When built and run with Node v20, the CPU load increases dramatically. One of the four cores runs at 100%. The machine is a Raspberry Pi 4 running the Debian Bullseye version of the OS.

What should have happened?

I expect that the CPU load will not very significantly between the Node 19.8.1 and Node 20.4 versions.
sptest.tar.gz

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions