lwip-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [lwip-devel] [task #6827] etharp could need some tuning


From: tmu
Subject: RE: [lwip-devel] [task #6827] etharp could need some tuning
Date: Tue, 19 Jun 2007 21:00:12 +0200
User-agent: Internet Messaging Program (IMP) 3.2.6

Quoting Goldschmidt Simon <address@hidden>:
> > That may be true for some architectures or compilers. But the loop in
>
> And it doesn't, for mine. On NIOS-II, a comparison is always register
> against register. Comparison against 0 is a comparison against r0 (which
> is bound to be 0). You have to have one register more, but I though
> maybe the compiler can optimize the for-loop better than the while
> (because the k-- is inside the body and not tight to the keyword like
> with for, is that right or not?).

I would assume modern compilers optimise use a broader scope and
such statement scheduling at high-level language is no longer
necessary ... if not even counterproductive.

> > question copies data 'backwards', i.e. accesses memory from higher to
> > lower addresses. That could level out the optimisation gained by
> > tweaking the loop abort criteria on some other architectures.
>
> That might also be. Anyway, I don't think it's that important anyway,
> just thought it's a strange way to do it (not the comparison against 0
> but using while instead of for when you know the size).

The optimisation using a constant instead of reading hw_addrlen(?)
is probably more useful than doing the work a decent compiler does
for you anyways.
FWIW, I'd be more concerned about latency cauded by memory
accesses than processor cycles caused by some additional operations
which use only local CPU resources.

-- 
Thomas




reply via email to

[Prev in Thread] Current Thread [Next in Thread]