You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: benchmark/CDT.Comparison.Benchmarks/README.md
+44-17Lines changed: 44 additions & 17 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -88,30 +88,57 @@ Results are written to `BenchmarkDotNet.Artifacts/` in the current directory.
88
88
| CGAL (C++) |`number_of_faces()` counts all finite triangles in the triangulation, consistent with artem-ogre/CDT. First build downloads CGAL 6.1.1 library headers (~10 MB) and the required Boost sub-library headers (~10 MB ZIPs, ~60 MB staged); subsequent builds use the cmake cache. |
89
89
| Spade (Rust) |`num_inner_faces()` returns only inner (non-convex-hull) triangles, which is fewer than the C++ CDT counts |
90
90
91
+
## Counts of triangles by library and category
92
+
93
+
```
94
+
Constrained Delaunay Triangulation
95
+
--------------------------------------
96
+
CDT.NET 5.239 triangles
97
+
artem-ogre/CDT (C++) 5.239 triangles
98
+
Spade (Rust) 5.204 triangles
99
+
CGAL (C++) 5.204 triangles
100
+
Triangle.NET 5.204 triangles
101
+
--------------------------------------
102
+
Conforming Delaunay Triangulation
103
+
--------------------------------------
104
+
CDT.NET 5.343 triangles
105
+
artem-ogre/CDT (C++) 5.343 triangles
106
+
Spade (Rust) 5.308 triangles
107
+
CGAL (C++) 5.324 triangles
108
+
NTS 5.764 triangles
109
+
Triangle.NET 5.204 triangles
110
+
--------------------------------------
111
+
```
112
+
91
113
## Benchmark results
92
114
93
115
> 12th Gen Intel Core i7-12700KF 3.60GHz, 1 CPU, 20 logical and 12 physical cores
94
116
95
-
| Method | Categories | Mean | Error | StdDev | Ratio | RatioSD |
| CDT.NET | Conforming | 1.442 ms | 0.1628 ms | 0.0089 ms | 1.00 |
120
+
| 'artem-ogre/CDT (C++)' | Conforming | 1.976 ms | 0.0501 ms | 0.0027 ms | 1.37 |
121
+
| 'Spade (Rust)' | Conforming | 1.341 ms | 0.2933 ms | 0.0161 ms | 0.93 |
122
+
| 'CGAL (C++)' | Conforming | 4.110 ms | 0.3934 ms | 0.0216 ms | 2.85 |
123
+
| NTS | Conforming | 38.288 ms | 39.8335 ms | 2.1834 ms | 26.55 |
124
+
| Triangle.NET | Conforming | 3.284 ms | 0.6901 ms | 0.0378 ms | 2.28 |
125
+
|||||||
126
+
| CDT.NET | Constrained | 1.167 ms | 0.0737 ms | 0.0040 ms | 1.00 |
127
+
| 'artem-ogre/CDT (C++)' | Constrained | 1.766 ms | 0.0619 ms | 0.0034 ms | 1.51 |
128
+
| 'Spade (Rust)' | Constrained | 1.256 ms | 0.1233 ms | 0.0068 ms | 1.08 |
129
+
| 'CGAL (C++)' | Constrained | 2.613 ms | 0.3773 ms | 0.0207 ms | 2.24 |
130
+
| Triangle.NET | Constrained | 3.290 ms | 1.3341 ms | 0.0731 ms | 2.82 |
131
+
|||||||
132
+
| CDT.NET | VerticesOnly | 1.072 ms | 0.0045 ms | 0.0002 ms | 1.00 |
133
+
| 'artem-ogre/CDT (C++)' | VerticesOnly | 1.568 ms | 0.2550 ms | 0.0140 ms | 1.46 |
134
+
| 'Spade (Rust)' | VerticesOnly | 1.038 ms | 0.0224 ms | 0.0012 ms | 0.97 |
135
+
| 'CGAL (C++)' | VerticesOnly | 2.156 ms | 0.2064 ms | 0.0113 ms | 2.01 |
136
+
| NTS | VerticesOnly | 5.608 ms | 2.5000 ms | 0.1370 ms | 5.23 |
137
+
| Triangle.NET | VerticesOnly | 1.355 ms | 0.0418 ms | 0.0023 ms | 1.26 |
111
138
112
139
### Key takeaways
113
140
114
-
-**CDT.NET matches the original C++ implementation (artem-ogre/CDT) and Spade within ≤13%** on both constrained and unconstrained triangulation.
141
+
-**CDT.NET matches the original C++ implementation (artem-ogre/CDT) and Spade within ≤13%**.
115
142
-**CGAL** runs at ~2× CDT.NET. CGAL's `Constrained_Delaunay_triangulation_2` uses a more complex data structure (half-edge DCEL) with additional bookkeeping overhead vs. CDT.NET's compact flat arrays. For raw triangulation throughput CDT.NET is faster.
116
143
-**CDT.NET allocates 5–120× less managed memory** than Triangle.NET and NTS: Triangle.NET allocates ~5.7× more, NTS ~121× more.
117
144
-**NTS (conforming CDT)** is ~30× slower and allocates ~120× more memory — Steiner-point insertion is the main cost, and the result is semantically different (not true CDT).
0 commit comments