I currently have 8 unique convex hulls (and by extension GetConvexHull is called 8 times). When I run the game in debug mode either with or without the debugger attached, I get times in the order of 100ms, and if I run it with a release build with the debugger I get the same; however, in release mode, without the debugger, the time taken for the most complex hull shoots up to the region of 2500ms. I can determine this accurately without using a debugger by wrapping calls to ConvexHull constructors with Stopwatch calls. (I'm calling this from two places but only wrapped the one, so there are 6 results not 8 )
Release build, no debugger:
Code: Select all
Milliseconds Taken for call to new ConvexHullShape with 1949 vertices of input data is 2355
Milliseconds Taken for call to new ConvexHullShape with 193 vertices of input data is 13
Milliseconds Taken for call to new ConvexHullShape with 105 vertices of input data is 27
Milliseconds Taken for call to new ConvexHullShape with 1836 vertices of input data is 723
Milliseconds Taken for call to new ConvexHullShape with 1284 vertices of input data is 2986
Milliseconds Taken for call to new ConvexHullShape with 593 vertices of input data is 133
Press any key to continue . . .
Code: Select all
Milliseconds Taken for call to new ConvexHullShape with 1949 vertices of input data is 210
Milliseconds Taken for call to new ConvexHullShape with 193 vertices of input data is 4
Milliseconds Taken for call to new ConvexHullShape with 105 vertices of input data is 3
Milliseconds Taken for call to new ConvexHullShape with 1836 vertices of input data is 63
Milliseconds Taken for call to new ConvexHullShape with 1284 vertices of input data is 119
Milliseconds Taken for call to new ConvexHullShape with 593 vertices of input data is 58
Code: Select all
Milliseconds Taken for call to new ConvexHullShape with 1949 vertices of input data is 230
Milliseconds Taken for call to new ConvexHullShape with 193 vertices of input data is 5
Milliseconds Taken for call to new ConvexHullShape with 105 vertices of input data is 3
Milliseconds Taken for call to new ConvexHullShape with 1836 vertices of input data is 67
Milliseconds Taken for call to new ConvexHullShape with 1284 vertices of input data is 140
Milliseconds Taken for call to new ConvexHullShape with 593 vertices of input data is 54
Code: Select all
Milliseconds Taken for call to new ConvexHullShape with 1949 vertices of input data is 3914
Milliseconds Taken for call to new ConvexHullShape with 193 vertices of input data is 8
Milliseconds Taken for call to new ConvexHullShape with 105 vertices of input data is 4
Milliseconds Taken for call to new ConvexHullShape with 1836 vertices of input data is 102
Milliseconds Taken for call to new ConvexHullShape with 1284 vertices of input data is 216
Milliseconds Taken for call to new ConvexHullShape with 593 vertices of input data is 79