File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
DelaunatorSharp.Benchmark Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ using BenchmarkDotNet . Attributes ;
2+ using BenchmarkDotNet . Engines ;
3+ using System . Collections . Generic ;
4+ using System . Linq ;
5+
6+ namespace DelaunatorSharp . Benchmark
7+ {
8+ [ SimpleJob ( RunStrategy . ColdStart , warmupCount : 10 , targetCount : 10 ) ]
9+ [ HtmlExporter ]
10+ public class GetVoronoiCellsBenchmark
11+ {
12+ private Distribution distribution = new Distribution ( ) ;
13+ private IPoint [ ] points ;
14+
15+ [ Params ( 5000 ) ]
16+ public int Count ;
17+
18+ [ ParamsAllValues ]
19+ public Distribution . Type Type { get ; set ; }
20+
21+ private Delaunator delaunator ;
22+
23+ [ GlobalSetup ]
24+ public void GlobalSetup ( )
25+ {
26+ points = distribution . GetPoints ( Type , Count ) . ToArray ( ) ;
27+ delaunator = new Delaunator ( points ) ;
28+ }
29+
30+ [ Benchmark ]
31+ public void GetVoronoiCells ( )
32+ {
33+ using var enumerator = delaunator . GetVoronoiCells ( ) . GetEnumerator ( ) ;
34+ while ( enumerator . MoveNext ( ) ) { }
35+ }
36+ }
37+ }
You can’t perform that action at this time.
0 commit comments