-
Notifications
You must be signed in to change notification settings - Fork 459
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
Fix minor code style points and redundancies. #1322
base: master
Are you sure you want to change the base?
Fix minor code style points and redundancies. #1322
Conversation
On such a large code base, I would avoid merely cosmetic changes. For such changes, I would author a There's a potential performance benefit (depending on the runtime) in the LINQ code, but nothing beats getting rid of LINQ to Objects alltoghedther. |
Thanks for your review. |
It's not my project! But, from my experience in .NET performance tuning and optimization, LINQ To Objects is a performance hog. It erases the types transforming everything in And then there are the delegate costs with the the creation of the delegate and its invocation. The convenience and readability of the code given by LINQ methods can be achieved by creating specialized methods that do not need delegates and operate on the specific collections. |
Sometimes the magic of LINQ falls apart when you really look at it. |
Careful with this. I also read the same kind of thing at the time. This benchmark was done more than 10 years ago, before .net Core 1. And I said in the comments, the same benchmark performed way better with newer revisions. |
@randruc, this project is targeting .NET Framework 4.6.2. How old do you think it is? And it's impossible or not cost effective to create a JIT compiler that handles every particular use case. |
From what I read in the code comments, the project started in 2005. |
I came across this project a couple months ago. |
OK. |
I have the opposite opinion regarding the number of assemblies. It's everything and the kitchen sink. Even demo code. I would split it into specialized assemblies. Why do I have to take RTSP if I only want WebRTC? |
IMHO, for a small project like this one, maintaining a whole lot of specialized assembly is not an easy task. The codebase is small, the resulting assemblies are small, and the big interest of this project is that it comes batteries included. No bad surprises with missing dependencies etc. |
Separation of concerns. Take only what you need. |
I understand. But again, for such a small project I don't see the point honestly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I appreciate it's a subjective choice but given I'm curently the one that spends the most time on the code base I prefer the explicit boolean checks.
AudioStream.LocalTrack.NoDtmfSupport == false
instead of
!AudioStream.LocalTrack.NoDtmfSupport
I find I often miss the '!' character and even without it I spend extra time calculating whether an expression is meant to be true/false. When it's explicitly stated I find it quicker to grasp>
Happy for the whitespace fixes, they always bug me as well.
Thanks for the review. I'll soon update the submission. |
Fix minor code style points and redundancies.