提交 d647940e 编写于 作者: HansBug's avatar HansBug 😆

dev(hansbug): add table content in README.md

上级 a4374af9
......@@ -148,14 +148,29 @@ For more quick start explanation and further usage, take a look at:
## Speed Performance
Here is the speed performance of all the operations in `FastTreeValue`
Here is the speed performance of all the operations in `FastTreeValue`, the following table is the performance comparison result with [dm-tree](https://github.com/deepmind/tree).
| | flatten | flatten(with path) | map | map(with path) |
| --------------------------------------------------- | :--------------: | :------------------: | :-------------------: | :-----------------: |
| [treevalue](https://github.com/opendilab/treevalue) | --- | **511 ns ± 6.92 ns** | **3.16 µs ± 42.8 ns** | **1.58 µs ± 30 ns** |
| [dm-tree](https://github.com/deepmind/tree) | 830 ns ± 8.53 ns | 11.9 µs ± 358 ns | 13.3 µs ± 87.2 ns | 62.9 µs ± 2.26 µs |
| | flatten | flatten(with path) | mapping | mapping(with path) |
| --------------------------------------------------- | :--------------: | :-------------------: | :-------------------: | :-------------------------: |
| [treevalue](https://github.com/opendilab/treevalue) | --- | **511 ns ± 6.92 ns** | **3.16 µs ± 42.8 ns** | **1.58 µs ± 30 ns** |
| | **flatten** | **flatten_with_path** | **map_structure** | **map_structure_with_path** |
| [dm-tree](https://github.com/deepmind/tree) | 830 ns ± 8.53 ns | 11.9 µs ± 358 ns | 13.3 µs ± 87.2 ns | 62.9 µs ± 2.26 µs |
The following 2 tables are the performance comparison result with [jax pytree](https://github.com/google/jax).
| | mapping | mapping(with path) | flatten | unflatten | flatten_values | flatten_keys |
| --------------------------------------------------- | :------------------: | :-------------------: | :------------------: | :------------------: | :------------------: | :------------------: |
| [treevalue](https://github.com/opendilab/treevalue) | **3.2 µs ± 85.5 ns** | **2.16 µs ± 123 ns** | **515 ns ± 7.53 ns** | **601 ns ± 5.99 ns** | **301 ns ± 12.9 ns** | **451 ns ± 17.3 ns** |
| | **tree_map** | **(Can not acheive)** | **tree_flatten** | **tree_unflatten** | **tree_leaves** | **tree_structure** |
| [jax pytree](https://github.com/google/jax) | 4.67 µs ± 184 ns | --- | 1.29 µs ± 27.2 ns | 742 ns ± 5.82 ns | 1.29 µs ± 22 ns | 1.27 µs ± 16.5 ns |
| | flatten + all | flatten + reduce | flatten + reduce(with init) | rise(given structure) | rise(automatic structure) |
| --------------------------------------------------- | :------------------: | :------------------: | :-------------------------: | :-------------------: | :-----------------------: |
| [treevalue](https://github.com/opendilab/treevalue) | **425 ns ± 9.33 ns** | **702 ns ± 5.93 ns** | **793 ns ± 13.4 ns** | **9.14 µs ± 129 ns** | **11.5 µs ± 182 ns** |
| | **tree_all** | **tree_reduce** | **tree_reduce(with init)** | **tree_transpose** | **(Can not acheive)** |
| [jax pytree](https://github.com/google/jax) | 1.47 µs ± 37 ns | 1.88 µs ± 27.2 ns | 1.91 µs ± 47.4 ns | 10 µs ± 117 ns | --- |
The following table is the performance comparison result with [tianshou Batch](https://github.com/thu-ml/tianshou).
| | get | set | init | deepcopy | stack | cat | split |
| ---------------------------------------------------- | :--------------------: | :--------------------: | :------------------: | :------------------: | :------------------: | :-------------------: | :----------------: |
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册