summaryrefslogtreecommitdiffstats
path: root/third_party/rust/plane-split/benches/split.rs
blob: c224bd7de75047a7065de511dc83e2e0144682e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#![feature(test)]

extern crate euclid;
extern crate plane_split;
extern crate test;

use euclid::vec3;
use plane_split::{make_grid, BspSplitter};
use std::sync::Arc;

#[bench]
fn bench_bsp(b: &mut test::Bencher) {
    let polys = Arc::new(make_grid(5));
    let mut splitter = BspSplitter::new();
    let view = vec3(0.0, 0.0, 1.0);
    b.iter(|| {
        let p = polys.clone();
        splitter.solve(&p, view);
    });
}