Re: Zahl gerade oder ungerade?



> Eine Integer-Divison (incl.remainder) braucht (mind. bei etwas älteren CPUs)
> meist einige/etliche Zyklen,


Irrtum vorbehalten, für aktuelle intel Core2 CPUs
http://www.intel.com/products/processor/manuals/

'Optimization Reference Manual'
http://www.intel.com/design/processor/manuals/248966.pdf

gelten wohl grob Angaben wie:

IDIV :
Latency: 22 Throughput 22

AND/OR/XOR :
Latency: 1 Throughput 0.33


Hinzu kommen offenbar in bestimmten Konstellationen (wie im vorliegenden Fall) sogar Optimierungen wie zB:
'Macro fusion'
http://www.intel.com/cd/ids/developer/asmo-na/eng/dc/enterprise/porting/281974.htm?page=3

wo unser optimaler Fall mit 'AND' (=TEST) und Verzweigung 'Then' (=> JE):
test eax,1
je 0000004E
sogar noch in einem (CPU-internen) OP zusammengefasst werden kann!

Binäre Logik ist halt die allereinfachste und 'reinste Form' von 'Mathematik',
sowie massgeschneidert für aktuelle Prozessoren...




--
Thomas Scheidegger - MVP .NET - 'NETMaster'
http://www.cetus-links.org/oo_dotnet.html - http://dnetmaster.net/


.



Relevant Pages

  • Re: [GIT PULL] Ext3 latency fixes
    ... On Sat, 4 Apr 2009, Jens Axboe wrote: ... I'm sorry, but that fsync thing _is_ a real-world case, and it's the one ... should make sure that we don't regress on the throughput side. ... we _have_ regressed on the latency side. ...
    (Linux-Kernel)
  • Re: IO scheduler based IO controller V10
    ... On Fri, 2 Oct 2009, Jens Axboe wrote: ... Mostly they care about throughput, and when they come running because ... So yes, latency is not ignored, but mostly they ...
    (Linux-Kernel)
  • Re: 2.6.12 Performance problems
    ... > at the cost of decreased throughput - can't ... "Low latency comes at the cost of decreased ... Threading the kernel ...
    (Linux-Kernel)
  • Re: 2.6.12 Performance problems
    ... > at the cost of decreased throughput - can't ... "Low latency comes at the cost of decreased ... Threading the kernel ...
    (Linux-Kernel)
  • Re: Reduce latencies for syncronous writes and high I/O priority requests in deadline IO scheduler
    ... improve throughput, by sending more consecutive requests together. ... The intent is not to boost throughput, but to reduce sync latency. ... With this tiotest run, you only test sequential readers competing, ...
    (Linux-Kernel)