Benchmark Bandwidth Units #1051

Closed
opened 2025-06-26 23:34:07 -05:00 by calgray · 3 comments
calgray commented 2025-06-26 23:34:07 -05:00 (Migrated from github.com)

It can be observed from lines such as: github.com/Cyan4973/xxHash@38d555879f/tests/bench/benchfn.c (L32)
and:
github.com/Cyan4973/xxHash@38d555879f/tests/bench/main.c (L69)

that MB and MiB in benchmarks both mean 2^20 bytes instead of 10^6 bytes.

This in turn suggests that it's likely that documentation reported bandwidths in GB/s are instead really in GiB/s, and should be ~7% higher for metric GB/s (the bigger number is often why internet and storage companies use metric units).

It can be observed from lines such as: https://github.com/Cyan4973/xxHash/blob/38d555879fddae7300ece2c0820b3332c1d5748f/tests/bench/benchfn.c#L32 and: https://github.com/Cyan4973/xxHash/blob/38d555879fddae7300ece2c0820b3332c1d5748f/tests/bench/main.c#L69 that MB and MiB in benchmarks both mean 2^20 bytes instead of 10^6 bytes. This in turn suggests that it's likely that documentation reported bandwidths in GB/s are instead really in GiB/s, and should be ~7% higher for metric GB/s (the bigger number is often why internet and storage companies use metric units).
tansy commented 2025-06-27 15:37:02 -05:00 (Migrated from github.com)

that MB and MiB in benchmarks both mean 2^20 bytes instead of 10^6 bytes.

Well, not the same.
M means 'mega' ie. 10^6.
Mi means 'mebi' ie. 2^20.

megabytes vs mebibytes

> that MB and MiB in benchmarks both mean 2^20 bytes instead of 10^6 bytes. Well, not the same. M means 'mega' ie. 10^6. Mi means 'mebi' ie. 2^20. [megabytes vs mebibytes](https://www.computernetworkingnotes.com/networking-tutorials/megabytes-mb-v-s-mebibytes-mib-differences-explained.html)
calgray commented 2026-09-18 21:35:30 -05:00 (Migrated from github.com)

Well, not the same.
M means 'mega' ie. 10^6.
Mi means 'mebi' ie. 2^20.

Thats the point. One also has to be aware that some products have long term systemically used an incorrect definition. Such things should at the very least be maintained to be consistent. Notorious examples are:

  • Windows explorer reports in "KB, MB, GB" when it really means "KiB, MiB, GiB" (finally fixed in 2026)
  • Floppy disks are still labelled with "1.44MB", but they are truly 2MB unformatted, ~1.47 MB formatted (~1.41 MiB)
> Well, not the same. M means 'mega' ie. 10^6. Mi means 'mebi' ie. 2^20. Thats the point. One also has to be aware that some products have long term systemically used an incorrect definition. Such things should at the very least be maintained to be consistent. Notorious examples are: * Windows explorer reports in "KB, MB, GB" when it really means "KiB, MiB, GiB" (finally fixed in 2026) * Floppy disks are still labelled with "1.44MB", but they are truly 2MB unformatted, ~1.47 MB formatted (~1.41 MiB)
Cyan4973 commented 2026-09-19 10:45:24 -05:00 (Migrated from github.com)

It used to be that MB and GB clearly meant 2^20 and 2^30 respectively.
Up to the 2000's, there was no doubt about the meaning of these terms.

Then things changed. Some actors (Apple notably, the storage industry), decided that using 10^6 and 10^9 instead would make their numbers bigger, and therefore better than competition. I have vivid memories of "tech" articles (effectively fanboys trolls) from circa 2010 that explained that Apple drives had more capacity than Windows ones, based on this deliberately confusing metric difference.

And then, well, everybody else had to follow suit to not be on the loosing end.

And now we have to use MiB and GiB to mean what MB and GB originally meant.

I look forward to the moment I'll be able to buy my next pack of 34.36 GB of RAM.

It used to be that MB and GB clearly meant 2^20 and 2^30 respectively. Up to the 2000's, there was no doubt about the meaning of these terms. Then things changed. Some actors (Apple notably, the storage industry), decided that using 10^6 and 10^9 instead would make their numbers bigger, and therefore better than competition. I have vivid memories of "tech" articles (effectively fanboys trolls) from circa 2010 that explained that Apple drives had more capacity than Windows ones, based on this deliberately confusing metric difference. And then, well, everybody else had to follow suit to not be on the loosing end. And now we have to use MiB and GiB to mean what MB and GB originally meant. I look forward to the moment I'll be able to buy my next pack of 34.36 GB of RAM.
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-Cyan4973/xxHash#1051
No description provided.