7 ms·
CPU speed is rarely a limitation because RAM is just stupid slow, and in MIPS and Alpha CPU's with HW support it's a rounding error as in well under 1% for most
by Retric 11y ago
CPU speed is rarely a limitation because RAM is just stupid slow, and in MIPS and Alpha CPU's with HW support it's a rounding error as in well under 1% for most code. Even software based overflow detection runs in the 5-10% range not 100-1,000% range your suggesting.
PS: There are several models you can test yourself. http://blog.regehr.org/archives/1154 http://blog.regehr.org/archives/1154
edit: http://resources.sei.cmu.edu/asset_files/TechnicalNote/2010_004_001_15164.pdf http://resources.sei.cmu.edu/asset_files/TechnicalNote/2010_... Has actual benchmarks in the 6-8% range.
- wtallis 11y agoYeah, it's pretty much a given that checking for overflow won't be the bottleneck when you're doing pointer arithmetic to traverse a large data structure. The memory accesses will dominate over the cost of the highly-predictable branches.