List Info

Thread: Re: Poor read() performance, and I can't profile it




Re: Poor read() performance, and I can't profile it
country flaguser name
United States
2008-06-06 05:48:17
Kirk Strauser wrote:
> Kris Kennaway wrote:
> 
>> I don't understand what you meant by "It's
also doing a lot of 
>> lseek()s to what is likely the current position
anyway (example: seek 
>> to 0x00, read 16 bytes, seek to 0x10, etc.)."
then.
> 
> I just meant that 16 was a smaller number than 4096 to
use in an 
> example.  
> 
> But anyway, it looks like I was wrong.  Each record in
this test file is 
> 144 bytes long, but instead of reading 144 bytes, it's
reading 4096 
> bytes then seeking backward 3952 (4096-144) bytes to
the start of the 
> next record.  For instance:
> 
>  99823 dumprecspg CALL  lseek(0x3,0x1c8,SEEK_SET,0)
>  99823 dumprecspg CALL  read(0x3,0x8106000,0x1000)
>  99823 dumprecspg CALL  lseek(0x3,0x258,SEEK_SET,0)
>  99823 dumprecspg CALL  read(0x3,0x8106000,0x1000)
>  99823 dumprecspg CALL  lseek(0x3,0x2e8,SEEK_SET,0)
>  99823 dumprecspg CALL  read(0x3,0x8106000,0x1000)
>  99823 dumprecspg CALL  lseek(0x3,0x378,SEEK_SET,0)
>  99823 dumprecspg CALL  read(0x3,0x8106000,0x1000)
> Now, I know this is suboptimal.  My code is a patch on
another, 
> longer-established project that I wasn't a part of, and
I probably can't 
> do a lot about it without a pretty major rewrite. 
Still, I can't 
> believe the same code is *so* much faster on Linux. 
I'd also swear that 
> this is a regression and that it used to run much
faster on the same 
> FreeBSD machine back when it was running 6.x, but I
never bothered to 
> benchmark it then because it didn't seem to be an
issue.

Can you confirm or provide a code sample?  What does strace
show on Linux?

Kris
_______________________________________________
freebsd-questionsfreebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-que
stions
To unsubscribe, send any mail to
"freebsd-questions-unsubscribefreebsd.org"

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )