Skip to content
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

Delimiter parser High CPU usage #1329

Closed
goodhoko opened this issue Sep 7, 2017 · 5 comments
Closed

Delimiter parser High CPU usage #1329

goodhoko opened this issue Sep 7, 2017 · 5 comments

Comments

@goodhoko
Copy link

goodhoko commented Sep 7, 2017

  • SerialPort Version: 5.0.0

  • NodeJS Version: v6.11.1

  • Operating System and Hardware Platform: Windows 10, x64

  • Have you checked the right version of the api docs?: yes

  • Are you having trouble installing and you checked the Installation Special Cases docs? no

  • Are you using Electron and have you checked the Electron Docs?: no

Summary of Problem

When I run this code:

const SerialPort = require('serialport')
const Delimiter = SerialPort.parsers.Delimiter

var port = new SerialPort('COM4')
var parser = port.pipe(new Delimiter({ delimiter: '#'}))

The Node.js process consumes about 30-40% of CPU. When I comment out construction of the parser, usage is around 1%. I first noticed this using serialport in electron, but it's the same in Node.
The device is not sending any data to the port, and the usage doesn't drop even after physically unplugging the cable.

Steps and Code to Reproduce the Issue

Just run the code above.

@reconbot
Copy link
Member

reconbot commented Sep 7, 2017

I'm willing to bet this is due to the recently closed windows write issue #1221 if you try with the latest 6.0.0 beta you might see an improvement. We'll release 6.0 once that has more testing.

Thanks!

@goodhoko
Copy link
Author

goodhoko commented Sep 8, 2017

I can confirm that after testing with 6.0.0-beta2 the usage dropped to around 0-1%!🎉
When can I expect rolling out 6.0.0 to npm?

@reconbot
Copy link
Member

reconbot commented Sep 8, 2017 via email

@goodhoko
Copy link
Author

goodhoko commented Sep 8, 2017

OK. Thanks.
Can I help somehow?

@reconbot
Copy link
Member

reconbot commented Sep 8, 2017

Keep using it and report any any issues you might have =) I think @dustmop would be happy to know of your success. =)

@reconbot reconbot closed this as completed Sep 8, 2017
@lock lock bot locked and limited conversation to collaborators Mar 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants