System.IO.Ports.ReadByte()

Open
#113,889 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
csharp

Research direction

Start at the System.IO.Ports.ReadByte() entry point and compare its behavior between .NET 6 and .NET 7/8/9. Reproduce the reported performance difference, then investigate why SerialPort.Read produces different characters; done means identifying and fixing the regression with a regression test covering both performance behavior and received data.

Written by the indexing model from the issue text.

Description

area-System.IO.Ports tenet-performance
Description

Hello, I have really big performance issues for method ReadByte() - the performance is more than 10 times slower.

The problem were tested and confirmed from my side on
NET7/8/9
Last stable version is NET6

I tried to use serialPort.Read instead, but when I converted it to chars the recieved chars are different (last part in video)

https://github.com/user-attachments/assets/cae65e0c-c574-41c6-8e68-220fc058b715

NET6 example

Image

NET9 example
Image

Dominant language
C#
Stars
18.3k
Forks
5.6k
PR merge metrics
PR metrics pending

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from dotnet/runtime

All issues in dotnet/runtime

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.