mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-09 13:42:56 +00:00
loader: ip: Do not call getsecs so much
getsecs is very costly, reuse the values we got before. Fetching a ~30MB kernel with the tftp command use to take ~26 seconds and now it's ~18 seconds. Reviewed by: imp, tsoome MFC after: 2 weeks Sponsored by: Beckhoff Automation GmbH & Co. KG Differential Revision: https://reviews.freebsd.org/D33408
This commit is contained in:
parent
4f36ed513c
commit
c5f24f5e0d
@ -101,10 +101,9 @@ sendrecv(struct iodesc *d,
|
||||
tmo = MINTMO;
|
||||
tlast = 0;
|
||||
tleft = 0;
|
||||
tref = getsecs();
|
||||
t = getsecs();
|
||||
tref = t = getsecs();
|
||||
for (;;) {
|
||||
if (MAXWAIT > 0 && (getsecs() - tref) >= MAXWAIT) {
|
||||
if (MAXWAIT > 0 && (t - tref) >= MAXWAIT) {
|
||||
errno = ETIMEDOUT;
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user