[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [task #6827] etharp could need some tuning
From: |
Jonathan Larmour |
Subject: |
[lwip-devel] [task #6827] etharp could need some tuning |
Date: |
Tue, 19 Jun 2007 16:33:21 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.12) Gecko/20070530 Fedora/1.5.0.12-1.fc5 Firefox/1.5.0.12 |
Follow-up Comment #39, task #6827 (project lwip):
It would be equivalent to:
for (k=6;k>0;k--)
and (unless the compiler optimises it by itself, which it might), that is
typically faster than:
for (k = 0; k < 6; k++) {
because it tends to be faster on processors to compare against 0, than
against a given constant. A constant adds to register pressure and has to be
maintained in a register, or saved/restored in memory at the end of each loop
for the check. Comparison against 0 can usually be done directly in a single
instruction (or if using CISC where both would be single instruction, it
would take fewer cycles).
Making your loops have a comparison against 0 does count as one of the more
obscure optimisations you can do though, I agree.
_______________________________________________________
Reply to this item at:
<http://savannah.nongnu.org/task/?6827>
_______________________________________________
Message sent via/by Savannah
http://savannah.nongnu.org/
- [lwip-devel] [task #6827] etharp could need some tuning, (continued)
- [lwip-devel] [task #6827] etharp could need some tuning, Simon Goldschmidt, 2007/06/08
- [lwip-devel] [task #6827] etharp could need some tuning, Frédéric Bernon, 2007/06/08
- [lwip-devel] [task #6827] etharp could need some tuning, Simon Goldschmidt, 2007/06/08
- [lwip-devel] [task #6827] etharp could need some tuning, Simon Goldschmidt, 2007/06/08
- [lwip-devel] [task #6827] etharp could need some tuning, Simon Goldschmidt, 2007/06/16
- [lwip-devel] [task #6827] etharp could need some tuning, Frédéric Bernon, 2007/06/17
- [lwip-devel] [task #6827] etharp could need some tuning, Simon Goldschmidt, 2007/06/18
- [lwip-devel] [task #6827] etharp could need some tuning, Simon Goldschmidt, 2007/06/18
- [lwip-devel] [task #6827] etharp could need some tuning, Frédéric Bernon, 2007/06/18
- [lwip-devel] [task #6827] etharp could need some tuning, Simon Goldschmidt, 2007/06/19
- [lwip-devel] [task #6827] etharp could need some tuning,
Jonathan Larmour <=
- Re: [lwip-devel] [task #6827] etharp could need some tuning, Thomas Mueller, 2007/06/19
- RE: [lwip-devel] [task #6827] etharp could need some tuning, Goldschmidt Simon, 2007/06/19
- RE: [lwip-devel] [task #6827] etharp could need some tuning, tmu, 2007/06/21
- [lwip-devel] [task #6827] etharp could need some tuning, Simon Goldschmidt, 2007/06/21
- [lwip-devel] [task #6827] etharp could need some tuning, Kieran Mansley, 2007/06/22
- [lwip-devel] [task #6827] etharp could need some tuning, Simon Goldschmidt, 2007/06/24
- [lwip-devel] [task #6827] etharp could need some tuning, Simon Goldschmidt, 2007/06/24
- [lwip-devel] [task #6827] etharp could need some tuning, Simon Goldschmidt, 2007/06/24
- [lwip-devel] [task #6827] etharp could need some tuning, Simon Goldschmidt, 2007/06/24
- [lwip-devel] [task #6827] etharp could need some tuning, Simon Goldschmidt, 2007/06/24