This repository has been archived by the owner on Jun 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 122
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Port tests from gl-native 14324 * Remove crud. * Set baselines * Add timing for dictionary generation * Remove access token * Use insert access token script to insert an access token * Update accessing the access token * Fix second accessToken * Refactor accessibility calculations (#318) * Port tests from gl-native 14324 * Port accessibility calcs * Fix typo from merge. * Match results from before optimization. * Remove temp commented code * Address some TODOs * Include exception from failing test Co-authored-by: jmkiley <jordan.kiley@mapbox.com> * Update MGLAnnotationViewIntegrationTests.mm Co-authored-by: jmkiley <jordan.kiley@mapbox.com> Co-authored-by: Jordan Kiley <jmkiley@users.noreply.github.com>
- Loading branch information
1 parent
28e4c59
commit fb2b28e
Showing
16 changed files
with
858 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#ifndef MGLSignpost_h | ||
#define MGLSignpost_h | ||
|
||
#include <os/log.h> | ||
#include <os/signpost.h> | ||
|
||
#define SIGNPOST_CONCAT2(x,y) x##y | ||
#define SIGNPOST_CONCAT(x,y) SIGNPOST_CONCAT2(x,y) | ||
#define SIGNPOST_NAME(x) SIGNPOST_CONCAT(signpost,x) | ||
// | ||
//#define MGL_EXPORT __attribute__((visibility ("default"))) | ||
// | ||
//MGL_EXPORT extern os_log_t MGLDefaultSignpostLog; | ||
//MGL_EXPORT extern os_signpost_id_t MGLDefaultSignpost; | ||
// | ||
/** | ||
Create an os_log_t (for use with os_signposts) with the "com.mapbox.mapbox" subsystem. | ||
This method checks `NSUserDefaults` for `MGLSignpostsEnabled`, otherwise will return `OS_LOG_DISABLED`. | ||
Typically you should add `-MGLSignpostsEnabled YES` as run arguments to the Xcode scheme when | ||
profiling. | ||
This is only required if you need to add categories other than the default. | ||
@param name Name for the log category. | ||
@return log object. | ||
*/ | ||
//MGL_EXPORT extern os_log_t MGLSignpostLogCreate(const char* name); | ||
|
||
|
||
|
||
//os_log_t log = os_log_create("com.mapbox.mapbox", name); | ||
// | ||
//OS_LOG_DISABLED | ||
|
||
|
||
#define MGL_CREATE_SIGNPOST(log) \ | ||
({ \ | ||
os_signpost_id_t SIGNPOST_NAME(__LINE__) = OS_SIGNPOST_ID_INVALID; \ | ||
if (__builtin_available(iOS 12.0, macOS 10.14, *)) { \ | ||
SIGNPOST_NAME(__LINE__) = os_signpost_id_generate(log); \ | ||
} \ | ||
SIGNPOST_NAME(__LINE__); \ | ||
}) | ||
|
||
#define MGL_SIGNPOST_BEGIN(log, signpost, name, ...) \ | ||
({ \ | ||
if (signpost != OS_SIGNPOST_ID_INVALID) { \ | ||
if (__builtin_available(iOS 12.0, macOS 10.14, *)) { \ | ||
os_signpost_interval_begin(log, signpost, name, ##__VA_ARGS__); \ | ||
} \ | ||
} \ | ||
}) | ||
|
||
#define MGL_SIGNPOST_END(log, signpost, name, ...) \ | ||
({ \ | ||
if (signpost != OS_SIGNPOST_ID_INVALID) { \ | ||
if (__builtin_available(iOS 12.0, macOS 10.14, *)) { \ | ||
os_signpost_interval_end(log, signpost, name, ##__VA_ARGS__); \ | ||
} \ | ||
} \ | ||
}) | ||
|
||
#define MGL_SIGNPOST_EVENT(log, signpost, name, ...) \ | ||
({ \ | ||
if (signpost != OS_SIGNPOST_ID_INVALID) { \ | ||
if (__builtin_available(iOS 12.0, macOS 10.14, *)) { \ | ||
os_signpost_event_emit(log, signpost, name, ##__VA_ARGS__); \ | ||
} \ | ||
} \ | ||
}) | ||
|
||
// Use MGL_SIGNPOST_BEGIN & MGL_SIGNPOST_END around sections of code that you | ||
// wish to profile. | ||
// MGL_SIGNPOST_EVENT can be used for single one-off events | ||
// | ||
// For example: | ||
// | ||
// os_signpost_id_t signpost = MGL_CREATE_SIGNPOST(); | ||
// MGL_SIGNPOST_BEGIN(signpost, "example"); | ||
// [self performAComputationallyExpensiveOperation]; | ||
// MGL_SIGNPOST_END(signpost, "example", "%d", numberOfWidgets); | ||
// | ||
// MGL_SIGNPOST_EVENT("error", "%d", errorCode); | ||
// | ||
//#define MGL_CREATE_SIGNPOST() MGL_NAMED_CREATE_SIGNPOST(MGLDefaultSignpostLog) | ||
// | ||
//#define MGL_SIGNPOST_BEGIN(signpost, name, ...) MGL_NAMED_SIGNPOST_BEGIN(MGLDefaultSignpostLog, signpost, name, ##__VA_ARGS__) | ||
//#define MGL_SIGNPOST_END(signpost, name, ...) MGL_NAMED_SIGNPOST_END(MGLDefaultSignpostLog, signpost, name, ##__VA_ARGS__) | ||
//#define MGL_SIGNPOST_EVENT(signpost, name, ...) MGL_NAMED_SIGNPOST_EVENT(MGLDefaultSignpostLog, signpost, name, ##__VA_ARGS__) | ||
|
||
#endif /* MGLSignpost_h */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.