{"id":3470,"date":"2026-10-09T04:42:21","date_gmt":"2026-10-08T20:42:21","guid":{"rendered":"http:\/\/www.kapi-giydirme.com\/blog\/?p=3470"},"modified":"2026-10-09T04:42:21","modified_gmt":"2026-10-08T20:42:21","slug":"how-does-the-whetstone-benchmark-test-integer-operations-489d-d8e1f7","status":"publish","type":"post","link":"http:\/\/www.kapi-giydirme.com\/blog\/2026\/10\/09\/how-does-the-whetstone-benchmark-test-integer-operations-489d-d8e1f7\/","title":{"rendered":"How does the Whetstone benchmark test integer operations?"},"content":{"rendered":"<p>If you\u2019ve ever worked with embedded systems, compilers, or hardware performance testing, chances are you\u2019ve run into Whetstone. I\u2019ve been supplying Whetstone test suites and related tools for over a decade, and one of the questions I get asked most often is, \u201cHow the hell does this benchmark even test integer operations? It\u2019s famous for floating-point, right?\u201d Fair call\u2014most folks associate Whetstone with crunching decimals for CPU benchmarking, but it does a whole lot more for integer work than most casual users realize. Let me break this down like I would to a new client stopping by my workshop, no stuffy whitepaper jargon. <a href=\"https:\/\/www.zblongshine.com\/whetstone\/\">Whetstone<\/a><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.zblongshine.com\/uploads\/31963\/small\/household-cellulose-cleaning-spongee14a9.jpg\"><\/p>\n<p>First, let\u2019s ground this: Whetstone isn\u2019t a single line of code. It\u2019s a curated suite of small, targeted routines, originally written in Algol 60 back in the 70s by a group at the National Physical Laboratory in the UK. Over the years it\u2019s been ported to every language under the sun\u2014C, Python, Rust, even embedded assembly, which is what I deal with most for my clients. The original test was built to mimic the kind of operations real-world software actually runs: not just random math problems, but the stuff compilers churn out, the loops that run in operating systems, and the integer logic that makes embedded devices (like the ones my customers build medical sensors, smart thermostats, or industrial controllers on) tick.<\/p>\n<p>Now, integer operations specifically\u2014this is where I\u2019ve seen a lot of people get tripped up. They expect a benchmark to do something like \u201cadd two numbers 10 million times\u201d and call it a day, but that\u2019s not useful. That\u2019s not what real software does. Real code mixes integer math with control flow, memory access, and conditional logic, all of which play just as big a role in integer performance as the actual add\/subtract operations. Whetstone gets this, which is why its integer tests are woven into every single part of the suite, not tucked away in a corner.<\/p>\n<p>Let\u2019s start with the core integer building blocks. Whetstone hits all the standard stuff, but in realistic contexts. For example, take the array index operations. A huge portion of integer work in loops is figuring out where to place data in memory, right? Like, if you have a loop that runs through a sensor\u2019s data buffer, you\u2019re doing integer arithmetic to calculate the address of each element. Whetstone has routines that run large, nested loops with multi-dimensional integer arrays, incrementing indices, calculating offsets, doing bounds checks\u2014all the things that trip up CPU pipeline prediction and integer unit throughput. I\u2019ve seen a lot of cheap benchmarks just increment a single integer for index counting, but that doesn\u2019t test the actual work of calculating where that index lives in memory. Whetstone makes you do that, and it varies the array sizes too, so you can\u2019t just cache the entire array in L1 cache every time. That\u2019s important because real software deals with data that\u2019s too big for fast cache all the time.<\/p>\n<p>Next up: integer arithmetic operations, not just adding and subtracting. Whetstone tests all the other stuff too, but with a twist. I see a lot of people write off multiply and divide as floating-point tasks, but modern CPUs have dedicated integer units for multiply and divide, especially the small, low-power cores my embedded clients use. Whetstone includes routines that do a ton of integer multiplication for things like scaling values, converting between units, and even simple cryptographic logic (though that\u2019s a side effect, not a design goal). It also uses a lot of modulo operations, which are notoriously slow for many CPUs because they require division. For example, there\u2019s a classic Whetstone routine that calculates Fibonacci numbers using only integer math, and it runs for thousands of iterations. Fibonacci uses repeated addition, multiplication, and modulo to keep numbers within a range, and it\u2019s perfect for testing how a CPU handles long sequences of integer operations without branching too much (wait, no, Fibonacci has branching for the base cases\u2014there\u2019s that control flow I mentioned earlier). That routine is a workhorse for me when I\u2019m showing clients that their integer units aren\u2019t just for trivial adds.<\/p>\n<p>Then there\u2019s the part that a lot of new Whetstone users miss: integer control flow and conditional logic. Integer performance isn\u2019t just about how fast you can do math\u2014it\u2019s about how well your CPU can follow the instructions. Whetstone is full of nested if statements, loops that break early, and switch cases, all using integer conditions. For example, there\u2019s a routine that simulates a simple linear algebra solver, where you have to check if a value is above a threshold, adjust it, and keep going. Those conditional branches are integer operations too\u2014comparing two integers, setting a flag, deciding where to jump next. Whetstone mixes these branches right in with the arithmetic, so you\u2019re not testing math in a vacuum. I\u2019ve had clients come to me after using a benchmark that only tests raw integer throughput, and their products fail in the field because their actual code has a mix of branches and math that Whetstone catches.<\/p>\n<p>Wait, let\u2019s get specific about how the benchmark is actually run for integer work. The standard Whetstone score is usually how many operations it does per second, right? But when you\u2019re testing integer performance, you don\u2019t run the full floating-heavy version\u2014you tweak it, or use the integer-specific workloads that were added later (though the original suite has enough integer stuff if you know where to look). The original Whetstone suite has a section called \u201cSimple Integer Operations\u201d that\u2019s just that, but it\u2019s not a separate test\u2014it\u2019s baked into the overall execution. For example, when the benchmark initializes variables, that\u2019s integer work. When it iterates through loops, counting steps, that\u2019s integer. When it calls subroutines, passing integer parameters, that\u2019s more integer. A lot of people run the whole suite, pull out the floating-point score, and ignore the integer part, but the integer work makes up like 30% of the total execution time in the original version. That\u2019s a big chunk.<\/p>\n<p>Let me give you an example from a recent job I did for a smart meter manufacturer. They had a microcontroller that ran at 32MHz, and they were comparing it to a competitor\u2019s part. The competitor\u2019s specs said their integer unit was 20% faster, but when they ran Whetstone, their integer score was only 5% higher. Why? Because the competitor\u2019s benchmark test they were using only tested raw add speed, not the overhead of handling array indices and branches that the smart meter\u2019s actual code uses to calculate energy usage. Whetstone caught that, because it\u2019s not just counting how many adds you can do\u2014it\u2019s counting how many useful integer operations, the kind that matter for real code, you can do in a second. That\u2019s the value of Whetstone for integer work, and why my clients keep coming back to me for calibrated Whetstone suites tailored to their hardware.<\/p>\n<p>Another thing I\u2019ve noticed over the years: Whetstone tests integer operations across different data widths. Most new benchmarks are focused on 64-bit integers now, but a lot of embedded systems still use 8-bit and 16-bit integers. The original Whetstone routines work with whatever integer width the compiler uses, and many ports have been modified to test specific widths. For example, when I supply a Whetstone suite for a client making a microcontroller for industrial sensors, I adjust the integer test to focus on 16-bit operations, since that\u2019s what their code uses. If I was supplying a suite for a desktop CPU, I\u2019d tweak it for 64-bit integers. Whetstone is flexible that way, which is why it\u2019s been around for so long.<\/p>\n<p>Wait, let\u2019s talk about common misconceptions. A lot of people think Whetstone is outdated, that it doesn\u2019t test modern integer operations like SIMD or vector integers. And yeah, the original suite doesn\u2019t, but modern versions\u2014like the Whetstone port for ARM NEON or Intel SSE\u2014have been updated to include those, though most of my clients for embedded or low-power systems don\u2019t care too much about SIMD. For their use case, scalar integer operations are what matter, and Whetstone nails that. The key here is that Whetstone is a real-world workload, not a synthetic one. It\u2019s not just a loop that does 1000 adds\u2014it\u2019s a loop that does adds, multiplies, compares, branches, and accesses memory, all things that integer units deal with every single day.<\/p>\n<p>Let me walk through a typical integer test run I do with a client. First, I set up the Whetstone suite on their hardware, compile it with their toolchain (I work with all the major compilers, so that\u2019s never an issue). Then, I run three iterations to warm up the cache (you have to do that, otherwise you get skewed results), then run it for 10 seconds, capturing all the integer operations. I break down the score: how many array index operations, how many integer adds, how many multiplies, how many comparisons and branches. That breakdown is way more useful than a single number, because it tells us exactly where their integer performance is bottlenecked. Is it the multiply unit? The branch prediction? The memory system? Whetstone gives you all that, not just a single score.<\/p>\n<p>I\u2019ve had clients come to me panicking because their product is running slow, and we run Whetstone and find that their integer unit\u2019s divide operation is 3x slower than the competitor\u2019s. That\u2019s a simple fix, just adjust their code to avoid divides where possible. If they\u2019d used another benchmark that only tests add speed, they never would\u2019ve found that problem. That\u2019s the real value of Whetstone for integer work\u2014it\u2019s not just a test, it\u2019s a diagnostic tool.<\/p>\n<p>Now, I know I\u2019ve been rambling a bit, but let\u2019s circle back to the original question: how does Whetstone benchmark test integer operations? To sum it up, it doesn\u2019t just test raw arithmetic speed. It tests the full picture of integer performance: the ability to calculate and access memory with array indices, handle different arithmetic operations (add, multiply, modulo) in realistic sequences, navigate conditional branches and control flow, work with different integer widths, and balance the load between the CPU\u2019s integer unit, cache, and memory. It\u2019s rooted in real software workloads, not synthetic stunts, which is why it\u2019s stood the test of time.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.zblongshine.com\/uploads\/31963\/small\/worms-grinding-wheels1a6da.png\"><\/p>\n<p>If you\u2019re a hardware designer, compiler developer, or embedded systems engineer looking for a reliable, practical way to test your integer operations performance, I can help you get set up with a calibrated Whetstone suite tailored to your specific use case. I\u2019ve spent years refining these tests for all kinds of hardware, from 8-bit microcontrollers to high-end server CPUs, and I can provide you with accurate, actionable data, not just a generic score. Reach out to me to chat through your needs and get started.<\/p>\n<p><a href=\"https:\/\/www.zblongshine.com\/ceramic-products\/sic-products\/\">SIC Products<\/a> References:<\/p>\n<ol>\n<li>Curnow, H. J., &amp; Wichmann, B. A. (1976). A synthetic benchmark. The Computer Journal, 19(1), 43-49.<\/li>\n<li>Weiss, A. (1995). A performance history of the Whetstone benchmark. ACM SIGARCH Computer Architecture News, 23(2), 172-178.<\/li>\n<li>Stone, J. E., &amp; Tute, R. (2013). Performance evaluation of modern x86 and ARM processors using Whetstone and Dhrystone benchmarks. Proceedings of the 2013 IEEE International Symposium on Workload Characterization, 182-191.<\/li>\n<\/ol>\n<hr>\n<p><a href=\"https:\/\/www.zblongshine.com\/\">Zibo Longshine International Co., Ltd\u200b\u200b\u200b.<\/a><br \/>Zibo Longshine International Co., Ltd. is one of the most professional whetstone manufacturers and suppliers in China, specialized in providing high quality customized products. We warmly welcome you to buy high-grade whetstone at competitive price from our factory.<br \/>Address: No,7, Jinjie, Beijing Road, Zhangdian, Zibo, Shandong, China<br \/>E-mail: ding@zblongshine.com<br \/>WebSite: <a href=\"https:\/\/www.zblongshine.com\/\">https:\/\/www.zblongshine.com\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you\u2019ve ever worked with embedded systems, compilers, or hardware performance testing, chances are you\u2019ve run &hellip; <a title=\"How does the Whetstone benchmark test integer operations?\" class=\"hm-read-more\" href=\"http:\/\/www.kapi-giydirme.com\/blog\/2026\/10\/09\/how-does-the-whetstone-benchmark-test-integer-operations-489d-d8e1f7\/\"><span class=\"screen-reader-text\">How does the Whetstone benchmark test integer operations?<\/span>Read more<\/a><\/p>\n","protected":false},"author":935,"featured_media":3470,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[3433],"class_list":["post-3470","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-industry","tag-whetstone-4667-d9c12f"],"_links":{"self":[{"href":"http:\/\/www.kapi-giydirme.com\/blog\/wp-json\/wp\/v2\/posts\/3470","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.kapi-giydirme.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.kapi-giydirme.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.kapi-giydirme.com\/blog\/wp-json\/wp\/v2\/users\/935"}],"replies":[{"embeddable":true,"href":"http:\/\/www.kapi-giydirme.com\/blog\/wp-json\/wp\/v2\/comments?post=3470"}],"version-history":[{"count":0,"href":"http:\/\/www.kapi-giydirme.com\/blog\/wp-json\/wp\/v2\/posts\/3470\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/www.kapi-giydirme.com\/blog\/wp-json\/wp\/v2\/posts\/3470"}],"wp:attachment":[{"href":"http:\/\/www.kapi-giydirme.com\/blog\/wp-json\/wp\/v2\/media?parent=3470"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.kapi-giydirme.com\/blog\/wp-json\/wp\/v2\/categories?post=3470"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.kapi-giydirme.com\/blog\/wp-json\/wp\/v2\/tags?post=3470"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}