|
| 1 | +# Performance Comparison |
| 2 | + |
| 3 | +Benchmark project is [here](https://github.com/iShape-Rust/iTriangle/tree/main/performance). |
| 4 | + |
| 5 | +All tests were run on a machine with the following specifications: |
| 6 | +**3 GHz 6-Core Intel Core i5, 40GB 2667 MHz DDR4** |
| 7 | + |
| 8 | +All results are presented in seconds. |
| 9 | + |
| 10 | +## Solvers: |
| 11 | + |
| 12 | +- **iTriangle(Unchecked-Raw)** v0.31.0 |
| 13 | +- **iTriangle(Raw)** v0.31.0 |
| 14 | +- **iTriangle(Delaunay)** v0.31.0 |
| 15 | + |
| 16 | + |
| 17 | +## Simple Star Test |
| 18 | + |
| 19 | +This test generates and triangulate 10,000 unique star-shaped polygons, one at a time. |
| 20 | +Each shape is defined by: |
| 21 | + |
| 22 | +- A unique radius scale (100 variations) |
| 23 | +- A unique rotation (100 steps across a full circle) |
| 24 | +- A given number of corners (count), each with 10 points |
| 25 | + |
| 26 | +_All shapes are clean (non-intersecting), and no mesh is reused — each one is processed independently._ |
| 27 | + |
| 28 | +<p align="center"> |
| 29 | + <img src="test_0.svg" width="200"/> |
| 30 | +</p> |
| 31 | + |
| 32 | +| Count | Unchecked | Raw | Delaunay |
| 33 | +|---------|--------------|---------------|--------------| |
| 34 | +| 4 | 0.047844 | 0.074298 | 0.139643 | |
| 35 | +| 8 | 0.098785 | 0.165002 | 0.284868 | |
| 36 | +| 16 | 0.210214 | 0.369625 | 0.591876 | |
| 37 | +| 32 | 0.455352 | 0.875200 | 1.256099 | |
| 38 | +| 64 | 0.987139 | 2.241044 | 2.873866 | |
| 39 | +| 128 | 2.107867 | 5.867757 | 7.073528 | |
| 40 | +| 256 | 4.481360 | 16.652639 | 18.894593 | |
| 41 | +| 512 | 9.372721 | 46.585559 | 50.478053 | |
| 42 | + |
| 43 | +## Star with Hole Test |
| 44 | + |
| 45 | +This test generates and triangulates 10,000 unique star-shaped polygons with a central hole, one at a time. |
| 46 | +Each shape is defined by: |
| 47 | + |
| 48 | +- A unique radius scale (100 variations) |
| 49 | +- A unique rotation (100 steps across a full circle) |
| 50 | +- A central hole generated as a smaller star |
| 51 | +- A given number of corners (count), each with 10 points |
| 52 | + |
| 53 | +_All shapes are clean (non-intersecting), and no mesh is reused — each one is processed independently._ |
| 54 | + |
| 55 | +<p align="center"> |
| 56 | + <img src="test_1.svg" width="200"/> |
| 57 | +</p> |
| 58 | + |
| 59 | +| Count | Unchecked | Raw | Delaunay |
| 60 | +|---------|--------------|---------------|--------------| |
| 61 | +| 4 | 0.110370 | 0.268433 | 0.369640 | |
| 62 | +| 8 | 0.229584 | 0.593994 | 0.781789 | |
| 63 | +| 16 | 0.480577 | 1.344304 | 1.689566 | |
| 64 | +| 32 | 1.031568 | 3.294683 | 3.976463 | |
| 65 | +| 64 | 2.223870 | 8.547062 | 9.689934 | |
| 66 | +| 128 | 4.708570 | 24.225092 | 26.156747 | |
| 67 | +| 256 | 9.891213 | 64.140800 | 71.023947 | |
| 68 | + |
| 69 | + |
| 70 | +## Rect with Star Holes Test |
| 71 | + |
| 72 | +This test generates and triangulates 25 unique rectangles filled with many 5 corners star-shaped holes. |
| 73 | + |
| 74 | +Each shape is defined by: |
| 75 | + |
| 76 | +- A large outer rectangle |
| 77 | +- A grid of count × count small stars as holes, each with: |
| 78 | +- A varying radius scale (5 variations) |
| 79 | +- A unique rotation (5 variations) |
| 80 | +- 5 corners per star, with 10 points per corner. |
| 81 | + |
| 82 | +_All shapes are clean (non-intersecting), and no mesh is reused — each one is processed independently._ |
| 83 | + |
| 84 | +<p align="center"> |
| 85 | + <img src="test_2.svg" width="200"/> |
| 86 | +</p> |
| 87 | + |
| 88 | +| Count | Unchecked | Raw | Delaunay |
| 89 | +|---------|--------------|---------------|--------------| |
| 90 | +| 4 | 0.003435 | 0.009029 | 0.037794 | |
| 91 | +| 8 | 0.013662 | 0.035041 | 0.112566 | |
| 92 | +| 16 | 0.062749 | 0.152936 | 0.313631 | |
| 93 | +| 32 | 0.268670 | 0.534618 | 0.927747 | |
| 94 | +| 64 | 1.343702 | 2.542741 | 4.774121 | |
| 95 | +| 128 | 5.680361 | 10.131110 | 23.526240 | |
| 96 | +| 256 | 25.201445 | 45.647115 | 196.863314 | |
| 97 | + |
0 commit comments