RE: [PATCH] gettime: minimize integer division

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

 



> -----Original Message-----
> From: Jens Axboe [mailto:axboe@xxxxxxxxx]
> Sent: Friday, December 21, 2012 7:33 AM
> To: Sam Bradshaw (sbradshaw)
> Cc: fio@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH] gettime: minimize integer division
> 
> On 2012-12-20 20:23, Sam Bradshaw wrote:
> >
> >
> > Something like this might work, though that amount of logic may
> > be equivalent in terms of cycles to the divide.
> 
> So I took a look at it. The costly bit is the division by
> cycles_per_usec, which the compiler has no other option than turn into a
> divq. The modulo and divide by 1M can be turned into something more
> clever, basically shifts and imull.
> 
> So how about the below? It turns the divq into multiplication and
> division by 10M, which should be considerably less expensive. Can you
> test and see how that works for you?

That works much better.  Several % lower execution time in fio_gettime().
IOPs look the same in my synthetic test but I'm not sure that's relevant;
(it probably just needs some more tweaking).

I'll keep hunting for other hot spots.

-Sam

 
��.n��������+%������w��{.n�������^n�r������&��z�ޗ�zf���h���~����������_��+v���)ߣ�

[Index of Archives]     [Linux Kernel]     [Linux SCSI]     [Linux IDE]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux