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

NSLogger can slow down internet connection #297

Open
Tibbs opened this issue Sep 14, 2020 · 2 comments
Open

NSLogger can slow down internet connection #297

Tibbs opened this issue Sep 14, 2020 · 2 comments

Comments

@Tibbs
Copy link

Tibbs commented Sep 14, 2020

I have been using NSLogger for a very long time and I find it extremely useful.
Having said that, about two years ago I started receiving emails from my users that my Mac apps slowed down their internet connection.
At first, I dismissed it as it didn't make sense but some users sent me screen recordings showing just that: when my app was running the internet download speed was significantly lower.
I identified that NSLogger can cause this slowdown. I was able to reproduce similar results, but it not consistent. For example, switching to another wifi network or restarting the computer can relieve the issue temporarily.
When in "slowdown mode" opening an app that has NSLogger or the NSLogger console can slow down my internet from about 20% to more than 50% tests after tests
Any thoughts?

@fpillet
Copy link
Owner

fpillet commented Sep 14, 2020

The main question you have to ask yourself is, why are you shipping a production app with logs enabled?

NSLogger logs are as efficient as possible but have never meant to be enabled all the time. There is a definite overhead, especially if the logger is connected to a log viewer. Besides, we are using low-level CFStream networking and this ought to be replaced after a Swift rewrite to use a different API because this one is not going to give optimal results now that the OS has changed so much.

@Tibbs
Copy link
Author

Tibbs commented Sep 15, 2020

@fpillet Thank you for your quick response and explanation. The problem is the release macro for NSLog() is LogMessageCompat() which enables NSLogger. If I remove that macro it doesn't create the connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants