Source-Changes archive

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

Re: CVS commit: syssrc/sys/arch/powerpc



well, I hadn't measured it, it was just an obvious change.
it stuck out like a sore thumb in the profiling output.

but since you asked, I did a little microbenchmarking.
"~/stat" does the obvious thing, just calls stat(argv[2]) argv[1] times.


old copy{in,out}str:
2 pm2:~/dm # time ~/stat 200000 `jot -b 0123456789abcde 64 | tr '\012' /`
0.279u 165.755s 2:46.18 99.9%   0+0k 1+7io 0pf+0w
3 pm2:~/dm # time ~/stat 200000 `jot -b 0123456789abcde 64 | tr '\012' /`
0.330u 165.737s 2:46.14 99.9%   0+0k 0+0io 0pf+0w
4 pm2:~/dm # time ~/stat 200000 `jot -b 0123456789abcde 64 | tr '\012' /`
0.289u 165.707s 2:46.10 99.9%   0+0k 0+0io 0pf+0w


new copy{in,out}str:
2 pm2:~/dm # time ~/stat 200000 `jot -b 0123456789abcde 64 | tr '\012' /`
0.279u 5.225s 0:05.47 100.3%    0+0k 1+0io 0pf+0w
3 pm2:~/dm # time ~/stat 200000 `jot -b 0123456789abcde 64 | tr '\012' /`
0.239u 5.269s 0:05.47 100.3%    0+0k 0+0io 0pf+0w
4 pm2:~/dm # time ~/stat 200000 `jot -b 0123456789abcde 64 | tr '\012' /`
0.275u 5.168s 0:05.50 98.7%     0+0k 0+3io 0pf+0w


so about 32 times faster.

what I was doing to during the original profiling runs was building kernels,
but the results varied enough that it was hard to see what effect this had
in a more realistic application.  it may speed that up by 1% or so.

mostly, it offended my sensibilities to have such a lame thing in there.  :-)

-Chuck


On Wed, Jul 24, 2002 at 07:27:17PM +1000, matthew green wrote:
>    
>    Modified Files:
>       syssrc/sys/arch/powerpc/conf: files.powerpc
>       syssrc/sys/arch/powerpc/powerpc: trap.c
>    Removed Files:
>       syssrc/sys/arch/powerpc/powerpc: copyinstr.c copyoutstr.c
>    
>    Log Message:
>    reimplement copy{in,out}str() similarly to copy{in,out}()
>    (instead of the old way of calling [fs]ubyte() in a loop).
> 
> 
> does this have a performance benefit?  (i assume so)  did you
> happen to measure it? :)



Home | Main Index | Thread Index | Old Index