"src/turbomind/CMakeLists.txt" did not exist on "fe46dac2c2ea1a988929fba05e9d3d3c9b11dfd7"
bm_mesh_io.py 1.57 KB
Newer Older
facebook-github-bot's avatar
facebook-github-bot committed
1
2
3
4
5
6
7
8
# Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.

from fvcore.common.benchmark import benchmark
from test_obj_io import TestMeshObjIO
from test_ply_io import TestMeshPlyIO


def bm_save_load() -> None:
9
    simple_kwargs_list = [
10
11
12
        {"V": 100, "F": 200},
        {"V": 1000, "F": 2000},
        {"V": 10000, "F": 20000},
facebook-github-bot's avatar
facebook-github-bot committed
13
14
    ]
    benchmark(
15
16
17
        TestMeshObjIO.bm_load_simple_obj_with_init,
        "LOAD_SIMPLE_OBJ",
        simple_kwargs_list,
facebook-github-bot's avatar
facebook-github-bot committed
18
19
20
        warmup_iters=1,
    )
    benchmark(
21
22
23
        TestMeshObjIO.bm_save_simple_obj_with_init,
        "SAVE_SIMPLE_OBJ",
        simple_kwargs_list,
facebook-github-bot's avatar
facebook-github-bot committed
24
25
26
        warmup_iters=1,
    )
    benchmark(
27
28
29
30
        TestMeshPlyIO.bm_load_simple_ply_with_init,
        "LOAD_SIMPLE_PLY",
        simple_kwargs_list,
        warmup_iters=1,
facebook-github-bot's avatar
facebook-github-bot committed
31
32
    )
    benchmark(
33
34
35
36
        TestMeshPlyIO.bm_save_simple_ply_with_init,
        "SAVE_SIMPLE_PLY",
        simple_kwargs_list,
        warmup_iters=1,
facebook-github-bot's avatar
facebook-github-bot committed
37
    )
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63

    complex_kwargs_list = [{"N": 8}, {"N": 32}, {"N": 128}]
    benchmark(
        TestMeshObjIO.bm_load_complex_obj,
        "LOAD_COMPLEX_OBJ",
        complex_kwargs_list,
        warmup_iters=1,
    )
    benchmark(
        TestMeshObjIO.bm_save_complex_obj,
        "SAVE_COMPLEX_OBJ",
        complex_kwargs_list,
        warmup_iters=1,
    )
    benchmark(
        TestMeshPlyIO.bm_load_complex_ply,
        "LOAD_COMPLEX_PLY",
        complex_kwargs_list,
        warmup_iters=1,
    )
    benchmark(
        TestMeshPlyIO.bm_save_complex_ply,
        "SAVE_COMPLEX_PLY",
        complex_kwargs_list,
        warmup_iters=1,
    )