MessageEventArgs - Memory usage double with setData without purpose
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- networking
Research direction
Start in MessageEventArgs.cs around lines 104-109 and inspect the linked commit's setData implementation and RawData path. Confirm how _data is populated when RawData is accessed, then change the behavior so RawData does not call setData while preserving the intended Data behavior. Done means RawData no longer creates the duplicated data described in the issue.
Written by the indexing model from the issue text.
Description
By looking at this commit and the code of setData
https://github.com/sta/websocket-sharp/commit/0b07b08ad0822e1b8063737989336b36b2d19cc1 there is no purpose of calling setData in get RawData.
This will create/duplicate an unused memory with _data that probably will hold a huge frame.
We can also think that _data has no real purpose else that not calling a conversion for each get Data but in some case, holding memory is heavier than CPU conversion usage.
https://github.com/sta/websocket-sharp/blob/0b3a346b86351840cb2171630a37d8b8c94855ce/websocket-sharp/MessageEventArgs.cs#L104-L109
At least please, make RawData not calling setData to keep a choice to have a clean memory usage.
- Dominant language
- C#
- Stars
- 6.1k
- Forks
- 1.7k
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from sta/websocket-sharp
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
sta/websocket-sharp#201 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 45/100
sta/websocket-sharp#762 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
sta/websocket-sharp#761 ·
-
Bad handling of sending stream makes lib not RFC compatible and KeepClean useless in some cases. Open
Difficulty 4/5 3-5 days Newbie friendliness 42/100
sta/websocket-sharp#760 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
sta/websocket-sharp#759 ·
All issues in sta/websocket-sharp
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 75/100
sillsdev/languageforge-lexbox#2665 ·
-
bug documentation frontend
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
azurenoops/spin_agent#975 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
:watch: Not Triaged 11.0 fundamentals/subsvc
Difficulty 2/5 1-3 hours Newbie friendliness 92/100
dotnet/AspNetCore.Docs#37699 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
SubtitleEdit/subtitleedit#15108 · 1 comment ·