mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-04 03:45:58 -05:00
Remove benchmark from path.length test.
This commit is contained in:
parent
78ce0831e3
commit
b4885afaac
1 changed files with 3 additions and 22 deletions
|
@ -6,30 +6,11 @@ test('path.length', function() {
|
||||||
new Segment(new Point(121, 334), new Point(-19, 38), new Point(30.7666015625, -61.53369140625)),
|
new Segment(new Point(121, 334), new Point(-19, 38), new Point(30.7666015625, -61.53369140625)),
|
||||||
new Segment(new Point(248, 320), new Point(-42, -74), new Point(42, 74))
|
new Segment(new Point(248, 320), new Point(-42, -74), new Point(42, 74))
|
||||||
]);
|
]);
|
||||||
var t = Date.now(), c = 1000;
|
|
||||||
for (var i = 0; i < c; i++) {
|
var length = path.length;
|
||||||
var length = path.length;
|
|
||||||
}
|
|
||||||
window.console.log(Date.now() - t, length);
|
|
||||||
// ai: 172.10122680664062
|
|
||||||
// 8: 172.10094440399325
|
|
||||||
// 7: 172.10190407418446
|
|
||||||
// 6: 172.09823801587845
|
|
||||||
// 5: 172.1100076851322
|
|
||||||
compareNumbers(length, 172.10122680664062);
|
compareNumbers(length, 172.10122680664062);
|
||||||
|
|
||||||
var curve = path.curves[0];
|
var param = path.curves[0].getParameter(length / 4);
|
||||||
var t = Date.now(), c = 1000;
|
|
||||||
for (var i = 0; i < c; i++) {
|
|
||||||
var param = curve.getParameter(length / 4);
|
|
||||||
}
|
|
||||||
window.console.log(Date.now() - t, param);
|
|
||||||
|
|
||||||
var param = curve.getParameter(length / 4);
|
|
||||||
// ai: 0.2255849553116685
|
|
||||||
// 8: 0.22558507711602457
|
|
||||||
// 5: 0.22558507714028128
|
|
||||||
// 4: 0.22558508917324532
|
|
||||||
compareNumbers(param, 0.2255849553116685);
|
compareNumbers(param, 0.2255849553116685);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue