Commit 02725138 authored by Yunxing Dai's avatar Yunxing Dai Committed by TensorFlower Gardener
Browse files

- Use InlinedVector for ShapeIndex.

- Use a separate IndexTable for lookups. This reduces the number of cachelines needed for storing ShapeTreeNodes.
- Set up benchmark for flat tuples, useful as a benchmark for future optimizations.

name                          old time/op    new time/op    delta
BM_Construct/2/8              8.34?s ? 1%    7.57?s ? 2%      -9.26%  (p=0.008 n=5+5)
BM_Construct/1/1000            143?s ? 1%     132?s ? 1%      -7.29%  (p=0.008 n=5+5)
BM_ConstructUnowned/2/8       2.18?s ? 4%    1.31?s ? 1%     -39.99%  (p=0.008 n=5+5)
BM_ConstructUnowned/1/1000    23.0?s ? 7%    15.1?s ? 1%     -34.47%  (p=0.008 n=5+5)
BM_Copy/2/8                   1.52?s ? 5%    0.37?s ? 1%     -76.01%  (p=0.008 n=5+5)
BM_Copy/1/1000                18.7?s ? 3%     4.9?s ? 2%     -73.85%  (p=0.008 n=5+5)
BM_Move/2/8                    0.03ns ? 2%   13.42ns ? 1%  +40877.10%  (p=0.016 n=4+5)
BM_Move/1/1000                 0.03ns ? 0%   13.54ns ? 3%  +40930.30%  (p=0.016 n=4+5)
BM_ForEach/2/8                 26.4ns ? 1%    27.9ns ? 2%      +5.77%  (p=0.008 n=5+5)
BM_ForEach/1/1000               271ns ? 1%     273ns ? 0%      +0.81%  (p=0.016 n=5+4)
BM_Iterate/2/8                 25.5ns ? 3%    23.9ns ? 8%        ~     (p=0.151 n=5+5)
BM_Iterate/1/1000               272ns ? 2%     271ns ? 1%        ~     (p=0.984 n=5+5)

name                          old allocs/op  new allocs/op  delta
BM_Construct/2/8                  373 ? 0%       276 ? 0%     -26.01%  (p=0.008 n=5+5)
BM_Construct/1/1000             5.00k ? 0%     4.00k ? 0%     -20.00%  (p=0.008 n=5+5)
BM_ConstructUnowned/2/8          99.0 ? 0%       2.0 ? 0%     -97.98%  (p=0.008 n=5+5)
BM_ConstructUnowned/1/1000      1.00k ? 0%     0.00k ? 0%     -99.80%  (p=0.008 n=5+5)
BM_Copy/2/8                       105 ? 0%        19 ? 0%     -81.90%  (p=0.008 n=5+5)
BM_Copy/1/1000                  1.31k ? 0%     0.25k ? 0%     -80.84%  (p=0.008 n=5+5)
BM_Move/2/8                      23.0 ? 0%      17.0 ? 0%     -26.09%  (p=0.008 n=5+5)
BM_Move/1/1000                    313 ? 0%       250 ? 0%     -20.13%  (p=0.008 n=5+5)
BM_ForEach/2/8                   23.0 ? 0%      17.0 ? 0%     -26.09%  (p=0.008 n=5+5)
BM_ForEach/1/1000                 313 ? 0%       250 ? 0%     -20.13%  (p=0.008 n=5+5)
BM_Iterate/2/8                   23.0 ? 0%      17.0 ? 0%     -26.09%  (p=0.008 n=5+5)
BM_Iterate/1/1000                 313 ? 0%       250 ? 0%     -20.13%  (p=0.008 n=5+5)

PiperOrigin-RevId: 205154861
parent 36c4bf11
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment