开发者

What means "cycles per byte" for the performance of algorithm?

What means "cycles per byte" for the performance of algorithm开发者_运维问答?


From Wikipedia:

Cycles per byte (sometimes abbreviated cpb) is a unit of measurement which indicates the number of clock cycles a microprocessor will perform per byte (usually of octet size) of data processed in an algorithm. It is commonly used as a partial indicator of real-world performance in cryptographic functions.

From a page on IBM:

(number of processors × processor_utilization × processor clock frequency) / Throughput rate in bytes per second or transaction per second = cycles per Byte or transaction.


A "cycle" (or "clock cycle") is one step that the CPU makes when processing instructions. In a modern CPU, many instructions will take one clock cycle, while other more complex instructions may take more than one.

The "bytes" probably refers to the size of the input to whatever function you're looking at. For example, if you're analysing a function that changes each character in a string to upper case, then you might have a loop that looks like:

for each character in string:
    load character
    change to upper case
    store character

The number of clock cycles to process each character could be called the "cycles per byte".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜