Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save astojilj/a2001f1e0a5241fab7ba1118475cf749 to your computer and use it in GitHub Desktop.

Select an option

Save astojilj/a2001f1e0a5241fab7ba1118475cf749 to your computer and use it in GitHub Desktop.
patch and measured numbers
diff --git a/src/mbgl/renderer/renderer_impl.cpp b/src/mbgl/renderer/renderer_impl.cpp
index 76c45aef7..a45c14d45 100644
--- a/src/mbgl/renderer/renderer_impl.cpp
+++ b/src/mbgl/renderer/renderer_impl.cpp
@@ -31,6 +31,8 @@
#include <mbgl/util/string.hpp>
#include <mbgl/util/logging.hpp>
+#import <QuartzCore/QuartzCore.h>
+
namespace mbgl {
using namespace style;
@@ -332,9 +334,14 @@ void Renderer::Impl::render(const UpdateParameters& updateParameters) {
}
if (placementChanged) {
+ auto t0 = CACurrentMediaTime();
placement->commit(updateParameters.timePoint);
+ auto t1 = CACurrentMediaTime();
crossTileSymbolIndex.pruneUnusedLayers(usedSymbolLayers);
+ auto t2 = CACurrentMediaTime();
updateFadingTiles();
+ auto t3 = (CACurrentMediaTime() - t2) * 1000;
+ printf("placementChanged %f \t %f \t %f ms\n", (t1 - t0) * 1000, (t2 - t1) * 1000, t3);
} else {
placement->setStale();
}
placementChanged 0.938917 1.945875 0.004750 ms
placementChanged 0.849042 1.825333 0.005917 ms
placementChanged 1.054750 1.780125 0.005125 ms
placementChanged 1.028125 2.045833 0.007958 ms
placementChanged 1.084875 1.912250 0.004958 ms
placementChanged 0.900542 1.993000 0.005375 ms
placementChanged 0.967333 1.952333 0.007500 ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment