-
-
Notifications
You must be signed in to change notification settings - Fork 320
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
OSLogger performance consideration #348
Comments
|
Thanks for bringing this up @toshi0383. We can get rid of the wrapper and use the API directly from the places where we log stuff. Not sure what implications it has but if Apple suggested it, they must be doing some optimizations that we are not aware of. |
My college @inamiy came up with this wrapper function. This way we don't waste memory. Maybe it worth trying it. 👌 func signpost( ..., format: StaticString, _ arg1: CVarArg, closure: () throws -> ()) throws {
os_signpost(..., format, arg1)
try closure()
...
}
func signpost( ..., format: StaticString, _ arg1: CVarArg, _ arg2: CVarArg, closure: () throws -> ()) throws {
os_signpost(..., format, arg1, arg2)
try closure()
...
} |
That's a good idea @inamiy. Feel free to open a PR with the change. Otherwise, I can tackle it myself next week. |
@yonaskolb are you using the metrics provided by those logs? I'm considering the removal of those logs but I want to make sure you are not using them. |
Nope, not using them. Happy to have them all removed |
OSLogs removed in #453 |
I noticed that
OSLogger
is potentially losing a built-in optimization fromos.signpost
.https://github.com/tuist/xcodeproj/blob/master/Sources/xcodeproj/Utils/OSLogger.swift
CVarArg...
causes unwanted memory allocation of an array each time.In WWDC 2016, Apple says "do not create a wrapper for

os_log
family functions". Maybe it applies tosignpost
too.https://developer.apple.com/videos/play/wwdc2016/721/
Any thoughts?
The text was updated successfully, but these errors were encountered: