NetBSD-Bugs archive

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

Re: kern/50571: src/sys/fs/udf/udf_subr.c:6465: obvious performance tidyup



    Date:        Fri, 18 Dec 2015 20:12:59 -0500
    From:        christos%zoulas.com@localhost (Christos Zoulas)
    Message-ID:  <20151219011259.AD7F117FDAB%rebar.astron.com@localhost>

  | helping the compiler to produce more efficient code has a better chance of
  | success today.

I wouldn't guarantee that it is a performance improvement, it depends
upon the size and alignment of pos & inflen, if inflen is relatively
small, and pos isn't aligned (and nor is pos+inflen) then the extra
costs of the memset machinations required are likely to outweigh the
cost of a few more 0 writes.

Aside from the question of whether it should have been done, you also
just inserted the code supplied in the initial PR from dcb314%hotmail.com@localhost
which leaves blob[0 ..  pos-1] uninitialised.

It needs an extra memset to correct that.

kre



Home | Main Index | Thread Index | Old Index