tangrams / tangram-unity

Mapzen maps for Unity3D
Other
166 stars 48 forks source link

[wip] Update for Earcut C# #67

Closed karimnaaji closed 6 years ago

karimnaaji commented 6 years ago

Benchmark on Samsung galaxy S7, release mode on a 4x4 tile area.

PolygonBuilder.OnEndPolygon():

Earcut, C# Native plugin Earcut, C++
72ms 57ms ~1.3x
67ms 49ms ~1.36x
79ms 44ms ~1.8x
67ms 48ms ~1.4x
Average 71.25ms 49.5ms ~1.44x

Earcut tesselation only:

Earcut, C# Native plugin Earcut, C++
25ms 9ms ~2.7x
17ms 8ms ~2.1x
11ms 9ms ~1.2x
15ms 13ms ~1.2x
Average 17ms 9.75ms ~1.74x

Memory consumption (total allocation) similar for both methods.

Despite the time difference, updates to the library & deployment will be easier and simpler to maintain.