bm_mesh_io.py 819 Bytes
Newer Older
facebook-github-bot's avatar
facebook-github-bot committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env python3
# 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:
    kwargs_list = [
        {"V": 100, "F": 300},
        {"V": 1000, "F": 3000},
        {"V": 10000, "F": 30000},
    ]
    benchmark(
        TestMeshObjIO.load_obj_with_init,
        "LOAD_OBJ",
        kwargs_list,
        warmup_iters=1,
    )
    benchmark(
        TestMeshObjIO.save_obj_with_init,
        "SAVE_OBJ",
        kwargs_list,
        warmup_iters=1,
    )
    benchmark(
        TestMeshPlyIO.load_ply_bm, "LOAD_PLY", kwargs_list, warmup_iters=1
    )
    benchmark(
        TestMeshPlyIO.save_ply_bm, "SAVE_PLY", kwargs_list, warmup_iters=1
    )