Skip to content

Comments

feat(core): Use divan for benchmark framework#6051

Merged
Xuanwo merged 1 commit intomainfrom
use-divan
Apr 18, 2025
Merged

feat(core): Use divan for benchmark framework#6051
Xuanwo merged 1 commit intomainfrom
use-divan

Conversation

@Xuanwo
Copy link
Member

@Xuanwo Xuanwo commented Apr 18, 2025

Which issue does this PR close?

None

Rationale for this change

Use divan as opendal's benchmark framework which is easy to use and have nice output:

types                    fastest       │ slowest       │ median        │ mean          │ samples │ iters
├─ buffer                              │               │               │               │         │
│  ├─ advance                          │               │               │               │         │
│  │  ├─ bytes           0.214 ns      │ 0.752 ns      │ 0.231 ns      │ 0.273 ns      │ 100     │ 409600
│  │  ├─ contiguous      1.309 ns      │ 8.037 ns      │ 1.368 ns      │ 1.692 ns      │ 100     │ 204800
│  │  ╰─ non_contiguous                │               │               │               │         │
│  │     ├─ 10           1.144 ns      │ 2.219 ns      │ 1.168 ns      │ 1.294 ns      │ 100     │ 204800
│  │     ├─ 1000         1.064 ns      │ 1.97 ns       │ 1.085 ns      │ 1.119 ns      │ 100     │ 204800
│  │     ╰─ 1000000      1.735 ns      │ 3.164 ns      │ 2.21 ns       │ 2.262 ns      │ 100     │ 102400
│  ├─ chunk                            │               │               │               │         │
│  │  ├─ bytes           0.002 ns      │ 0.471 ns      │ 0.002 ns      │ 0.008 ns      │ 100     │ 819200
│  │  ├─ contiguous      0.049 ns      │ 0.341 ns      │ 0.067 ns      │ 0.08 ns       │ 100     │ 819200
│  │  ╰─ non_contiguous                │               │               │               │         │
│  │     ├─ 10           0.025 ns      │ 0.869 ns      │ 0.038 ns      │ 0.086 ns      │ 100     │ 409600
│  │     ├─ 1000         0.069 ns      │ 0.7 ns        │ 0.155 ns      │ 0.194 ns      │ 100     │ 409600
│  │     ╰─ 1000000      1.276 ns      │ 3.496 ns      │ 1.608 ns      │ 1.676 ns      │ 100     │ 102400
│  ├─ iterator                         │               │               │               │         │
│  │  ├─ contiguous      15.9 µs       │ 44.93 µs      │ 18.14 µs      │ 19.59 µs      │ 100     │ 200
│  │  ╰─ non_contiguous                │               │               │               │         │
│  │     ├─ 10           16.9 µs       │ 31.95 µs      │ 17.53 µs      │ 18.14 µs      │ 100     │ 200
│  │     ├─ 1000         16.71 µs      │ 36.21 µs      │ 17.54 µs      │ 18.88 µs      │ 100     │ 200
│  │     ╰─ 1000000      17.42 µs      │ 28.13 µs      │ 18 µs         │ 19.47 µs      │ 100     │ 200
│  ╰─ truncate                         │               │               │               │         │
│     ├─ bytes           19.34 ns      │ 35.23 ns      │ 19.66 ns      │ 20.35 ns      │ 100     │ 12800
│     ├─ contiguous      19.89 ns      │ 86.42 ns      │ 28.27 ns      │ 28.72 ns      │ 100     │ 12800
│     ╰─ non_contiguous                │               │               │               │         │
│        ├─ 10           19.41 ns      │ 35.7 ns       │ 29.29 ns      │ 29.07 ns      │ 100     │ 6400
│        ├─ 1000         21.3 ns       │ 34.62 ns      │ 21.77 ns      │ 22.37 ns      │ 100     │ 6400
│        ╰─ 1000000      35.85 ns      │ 97.85 ns      │ 59.02 ns      │ 59.71 ns      │ 100     │ 3200
╰─ tasks                               │               │               │               │         │
   ├─ baseline           261 ms        │ 266.4 ms      │ 263.9 ms      │ 263.6 ms      │ 100     │ 100
   ╰─ concurrent                       │               │               │               │         │
      ├─ 1               260 ms        │ 265.3 ms      │ 264 ms        │ 263.6 ms      │ 100     │ 100
      ├─ 2               30.17 ms      │ 43.3 ms       │ 31.79 ms      │ 32.46 ms      │ 100     │ 100
      ├─ 8               11.43 ms      │ 14.84 ms      │ 12.51 ms      │ 13.04 ms      │ 100     │ 100
      ╰─ 32              5.339 ms      │ 7.669 ms      │ 6.334 ms      │ 6.328 ms      │ 100     │ 100

What changes are included in this PR?

Use divan instead.

Are there any user-facing changes?

None.

@dosubot dosubot bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Apr 18, 2025
@Xuanwo Xuanwo requested review from dqhl76 and yihong0618 April 18, 2025 06:36
@dosubot dosubot bot added core releases-note/feat The PR implements a new feature or has a title that begins with "feat" labels Apr 18, 2025
@yihong0618
Copy link
Contributor

yihong0618 commented Apr 18, 2025

fs on my side
Timer precision: 41 ns

ops                  fastest       │ slowest       │ median        │ mean          │ samples │ iters
├─ read                            │               │               │               │         │
│  ├─ whole                        │               │               │               │         │
│  │  ├─ 1.00 MiB    104.8 µs      │ 275.7 µs      │ 116.6 µs      │ 125.7 µs      │ 100     │ 100
│  │  │              9.998 GB/s    │ 3.803 GB/s    │ 8.991 GB/s    │ 8.34 GB/s     │         │
│  │  ├─ 4.00 KiB    33.83 µs      │ 115.6 µs      │ 45.62 µs      │ 48.55 µs      │ 100     │ 100
│  │  │              121 MB/s      │ 35.41 MB/s    │ 89.77 MB/s    │ 84.35 MB/s    │         │
│  │  ├─ 16.0 MiB    1.588 ms      │ 2.76 ms       │ 1.799 ms      │ 1.874 ms      │ 100     │ 100
│  │  │              10.56 GB/s    │ 6.077 GB/s    │ 9.32 GB/s     │ 8.951 GB/s    │         │
│  │  ╰─ 64.0 KiB    33.24 µs      │ 265.9 µs      │ 34.99 µs      │ 44.58 µs      │ 100     │ 100
│  │                 1.971 GB/s    │ 246.3 MB/s    │ 1.872 GB/s    │ 1.47 GB/s     │         │
│  ╰─ concurrent                   │               │               │               │         │
│     ├─ baseline    
151.7 ms      │ 699.3 ms      │ 161.2 ms      │ 167.9 ms      │ 100     │ 100
│     │              7.075 GB/s    │ 1.535 GB/s    │ 6.657 GB/s    │ 6.392 GB/s    │         │
│     ╰─ concurrent                │               │               │               │         │
│        ├─ 1        156.3 ms      │ 327.5 ms      │ 166.9 ms      │ 170.2 ms      │ 100     │ 100
│        │           6.865 GB/s    │ 3.277 GB/s    │ 6.429 GB/s    │ 6.308 GB/s    │         │
│        ├─ 2        113.7 ms      │ 273.7 ms      │ 121 ms        │ 130 ms        │ 100     │ 100
│        │           9.437 GB/s    │ 3.921 GB/s    │ 8.866 GB/s    │ 8.259 GB/s    │         │
│        ├─ 4        95.49 ms      │ 237.2 ms      │ 111 ms        │ 121 ms        │ 100     │ 100
│        │           11.24 GB/s    │ 4.526 GB/s    │ 9.669 GB/s    │ 8.869 GB/s    │         │
│        ├─ 8        92.57 ms      │ 236.4 ms      │ 114.3 ms      │ 124.1 ms      │ 100     │ 100
│        │           11.59 GB/s    │ 4.54 GB/s     │ 9.387 GB/s    │ 8.65 GB/s     │         │
│        ╰─ 16       90.43 ms      │ 213.1 ms      │ 103.7 ms      │ 111 ms        │ 100     │ 100
│                    11.87 GB/s    │ 5.036 GB/s    │ 10.34 GB/s    │ 9.671 GB/s    │         │
╰─ write                           │               │               │               │         │
   ├─ whole                        │               │               │               │         │
   │  ├─ 1.00 MiB    2.453 ms      │ 9.168 ms      │ 4.11 ms       │ 4.233 ms      │ 100     │ 100
   │  │              427.3 MB/s    │ 114.3 MB/s    │ 255 MB/s      │ 247.6 MB/s    │         │
   │  ├─ 4.00 KiB    2.145 ms      │ 6.01 ms       │ 3.951 ms      │ 3.783 ms      │ 100     │ 100
   │  │              1.909 MB/s    │ 681.5 KB/s    │ 1.036 MB/s    │ 1.082 MB/s    │         │
   │  ├─ 16.0 MiB    16.06 ms      │ 41.49 ms      │ 18.97 ms      │ 20.7 ms       │ 100     │ 100
   │  │              1.044 GB/s    │ 404.2 MB/s    │ 884.1 MB/s    │ 810.3 MB/s    │         │
   │  ╰─ 64.0 KiB    2.079 ms      │ 6.222 ms      │ 3.861 ms      │ 3.862 ms      │ 100     │ 100
   │                 31.52 MB/s    │ 10.53 MB/s    │ 16.97 MB/s    │ 16.96 MB/s    │         │
   ╰─ concurrent                   │               │               │               │         │
      ├─ baseline    48.06 ms      │ 111.1 ms      │ 55.32 ms      │ 57.54 ms      │ 100     │ 100
      │              1.396 GB/s    │ 603.7 MB/s    │ 1.212 GB/s    │ 1.166 GB/s    │         │
      ╰─ concurrent                │               │               │               │         │
         ├─ 1        28.74 ms      │ 53.28 ms      │ 33.21 ms      │ 34.67 ms      │ 100     │ 100
         │           2.334 GB/s    │ 1.259 GB/s    │ 2.02 GB/s     │ 1.935 GB/s    │         │
         ├─ 2        25.42 ms      │ 183.1 ms      │ 113.3 ms      │ 109.9 ms      │ 100     │ 100
         │           2.639 GB/s    │ 366.4 MB/s    │ 591.8 MB/s    │ 610.1 MB/s    │         │
         ├─ 4        99.51 ms      │ 363.4 ms      │ 127.7 ms      │ 139.7 ms      │ 100     │ 100
         │           674.3 MB/s    │ 184.6 MB/s    │ 525.4 MB/s    │ 480.3 MB/s    │         │
         ╰─ 8        97.02 ms      │ 177.9 ms      │ 114.4 ms      │ 122.5 ms      │ 100     │ 100
                     691.6 MB/s    │ 377.2 MB/s    │ 586.3 MB/s    │ 547.6 MB/s    │         │

@Xuanwo Xuanwo merged commit 782f43d into main Apr 18, 2025
267 checks passed
@Xuanwo Xuanwo deleted the use-divan branch April 18, 2025 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

core releases-note/feat The PR implements a new feature or has a title that begins with "feat" size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants