[procps] Re: recent library change

  • From: Jaromir Capik <jcapik@xxxxxxxxxx>
  • To: procps@xxxxxxxxxxxxx
  • Date: Tue, 2 Apr 2013 08:39:35 -0400 (EDT)

> Hi Craig, Sergey, et.al.

Hi Jim.

> 
> Attached are 2 additional patches to the library, both dealing with the
> recent file2str dynamic buffer change.
> 
> The first one just makes that routine more efficient by reducing the number
> of read() and xrealloc() calls.

Jim, please, do more simulations. This is not more efficient.
For example for sizes from 5152 to 8192 the new code actually
does one extra reallocation in compare to the current code.

---
TESTING 8191
xcalloc size = 4096
xrealloc size = 5151
tot_read = 4096
xrealloc size = 10270
tot_read = 8191
result = 8191
strlen = 8191
---

Even if you reuse such block of memory, the benefit is uncertain
and the code looks strange. I believe you focus too much on stuff
that is unimportant. IMO there are other problems in the code which
need our attention.


Regards,
Jaromir.

Other related posts: