Optimizations (#161)

- cache body sim indices and split out fat aabb
- deferred restitution
- the manifold point normal velocity is only computed for restitution or
hit events, otherwise it is zero
This commit is contained in:
Erin Catto 2026-09-20 15:54:52 -07:00 • committed by GitHub
commit 9e5a4cde86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
49 changed files with 3395 additions and 864 deletions

View file

@ -1,9 +1,9 @@
threads,ms
1,14441.9
2,7238.43
3,4870.13
4,3697.34
5,2998.67
6,2533.13
7,2209.12
8,1983.89
1,13564.7
2,7058.44
3,4749.26
4,3596.92
5,2921.35
6,2478.9
7,2163.02
8,1919.1

1 threads ms
2 1 14441.9 13564.7
3 2 7238.43 7058.44
4 3 4870.13 4749.26
5 4 3697.34 3596.92
6 5 2998.67 2921.35
7 6 2533.13 2478.9
8 7 2209.12 2163.02
9 8 1983.89 1919.1

View file

@ -1,9 +1,9 @@
threads,ms
1,1323.84
2,691.063
3,463.698
4,353.723
5,284.09
6,240.864
7,209.11
8,185.953
1,1341.05
2,697.405
3,467.98
4,355.631
5,285.912
6,240.761
7,210.048
8,187.1

1 threads ms
2 1 1323.84 1341.05
3 2 691.063 697.405
4 3 463.698 467.98
5 4 353.723 355.631
6 5 284.09 285.912
7 6 240.864 240.761
8 7 209.11 210.048
9 8 185.953 187.1

View file

@ -1,9 +1,9 @@
threads,ms
1,16467.5
2,8687.63
3,5966.06
4,4569.55
5,3727.89
6,3175.51
7,2801.72
8,2512.32
1,14783.1
2,7859.85
3,5367.48
4,4115.03
5,3368.76
6,2874.23
7,2535.89
8,2277.2

1 threads ms
2 1 16467.5 14783.1
3 2 8687.63 7859.85
4 3 5966.06 5367.48
5 4 4569.55 4115.03
6 5 3727.89 3368.76
7 6 3175.51 2874.23
8 7 2801.72 2535.89
9 8 2512.32 2277.2

View file

@ -1,9 +1,9 @@
threads,ms
1,1993.6
2,1049.01
3,712.917
4,544.335
5,443.056
6,384.22
7,331.626
8,297.982
1,1852.7
2,978.38
3,665.353
4,505.116
5,411.56
6,356.776
7,307.866
8,276.957

1 threads ms
2 1 1993.6 1852.7
3 2 1049.01 978.38
4 3 712.917 665.353
5 4 544.335 505.116
6 5 443.056 411.56
7 6 384.22 356.776
8 7 331.626 307.866
9 8 297.982 276.957

View file

@ -1,9 +1,9 @@
threads,ms
1,7.6329
2,9.7115
3,10.7648
4,11.2398
5,12.029
6,12.1204
7,12.2289
8,12.5125
1,7.1447
2,9.0736
3,10.1672
4,10.5088
5,11.0298
6,11.2858
7,11.378
8,11.4947

1 threads ms
2 1 7.6329 7.1447
3 2 9.7115 9.0736
4 3 10.7648 10.1672
5 4 11.2398 10.5088
6 5 12.029 11.0298
7 6 12.1204 11.2858
8 7 12.2289 11.378
9 8 12.5125 11.4947

View file

@ -1,9 +1,9 @@
threads,ms
1,2075.59
2,1084.54
3,722.057
4,549.644
5,437.772
6,372.242
7,319.13
8,283.131
1,1947.41
2,1002.95
3,663.846
4,499.942
5,405.97
6,336.977
7,291.483
8,255.782

1 threads ms
2 1 2075.59 1947.41
3 2 1084.54 1002.95
4 3 722.057 663.846
5 4 549.644 499.942
6 5 437.772 405.97
7 6 372.242 336.977
8 7 319.13 291.483
9 8 283.131 255.782

View file

@ -1,9 +1,9 @@
threads,ms
1,2102.47
2,1147.85
3,803.547
4,630.96
5,524.168
6,452.1
7,404.499
8,370.325
1,2061.72
2,1139.07
3,794.05
4,622.555
5,516.441
6,446.451
7,399.084
8,364.345

1 threads ms
2 1 2102.47 2061.72
3 2 1147.85 1139.07
4 3 803.547 794.05
5 4 630.96 622.555
6 5 524.168 516.441
7 6 452.1 446.451
8 7 404.499 399.084
9 8 370.325 364.345

View file

@ -1,9 +1,9 @@
threads,ms
1,1144.18
2,613.407
3,423.032
4,329.512
5,272.901
6,239.65
7,216.5
8,200.217
1,1051.05
2,568.185
3,390.055
4,304.593
5,251.978
6,221.25
7,200.171
8,185.485

1 threads ms
2 1 1144.18 1051.05
3 2 613.407 568.185
4 3 423.032 390.055
5 4 329.512 304.593
6 5 272.901 251.978
7 6 239.65 221.25
8 7 216.5 200.171
9 8 200.217 185.485

View file

@ -1,9 +1,9 @@
threads,ms
1,3173.87
2,1841.25
3,1325.07
4,1061.04
5,902.193
6,803.715
7,734.266
8,689.781
1,3152.3
2,1832.83
3,1315.75
4,1058.49
5,903.367
6,801.254
7,738.93
8,695.326

1 threads ms
2 1 3173.87 3152.3
3 2 1841.25 1832.83
4 3 1325.07 1315.75
5 4 1061.04 1058.49
6 5 902.193 903.367
7 6 803.715 801.254
8 7 734.266 738.93
9 8 689.781 695.326

View file

@ -1,9 +1,9 @@
threads,ms
1,170.276
2,112.037
3,88.2708
4,78.4451
5,74.3577
6,71.868
7,70.6687
8,69.1284
1,170.933
2,112.916
3,89.6041
4,79.6461
5,75.7754
6,73.2911
7,71.7742
8,70.7292

1 threads ms
2 1 170.276 170.933
3 2 112.037 112.916
4 3 88.2708 89.6041
5 4 78.4451 79.6461
6 5 74.3577 75.7754
7 6 71.868 73.2911
8 7 70.6687 71.7742
9 8 69.1284 70.7292

View file

@ -1,9 +1,9 @@
threads,ms
1,673.356
2,395.07
3,291.336
4,249.378
5,225.709
6,211.1
7,201.452
8,194.379
1,680.981
2,400.129
3,296.389
4,252.676
5,229.879
6,214.117
7,204.083
8,196.839

1 threads ms
2 1 673.356 680.981
3 2 395.07 400.129
4 3 291.336 296.389
5 4 249.378 252.676
6 5 225.709 229.879
7 6 211.1 214.117
8 7 201.452 204.083
9 8 194.379 196.839

View file

@ -1,9 +1,9 @@
threads,ms
1,285.24
2,174.635
3,132.161
4,116.509
5,107.948
6,102.503
7,98.9163
8,96.5196
1,295.508
2,183.122
3,139.634
4,121.466
5,113.262
6,106.697
7,103.854
8,101.959

1 threads ms
2 1 285.24 295.508
3 2 174.635 183.122
4 3 132.161 139.634
5 4 116.509 121.466
6 5 107.948 113.262
7 6 102.503 106.697
8 7 98.9163 103.854
9 8 96.5196 101.959

View file

@ -1,9 +1,9 @@
threads,ms
1,21430.4
2,11407.7
3,7908.09
4,6102.55
5,5012.68
6,4272.59
7,3783.33
8,3415.5
1,19931.1
2,10626.7
3,7300.85
4,5627.16
5,4603.18
6,3931.89
7,3454.58
8,3273.54

1 threads ms
2 1 21430.4 19931.1
3 2 11407.7 10626.7
4 3 7908.09 7300.85
5 4 6102.55 5627.16
6 5 5012.68 4603.18
7 6 4272.59 3931.89
8 7 3783.33 3454.58
9 8 3415.5 3273.54

View file

@ -188,7 +188,6 @@ int main( int argc, char** argv )
.solveImpulses = FLT_MAX,
.integratePositions = FLT_MAX,
.relaxImpulses = FLT_MAX,
.applyRestitution = FLT_MAX,
.storeImpulses = FLT_MAX,
.splitIslands = FLT_MAX,
.transforms = FLT_MAX,