Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Programming Threads > Re: Scalable ha...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 10 of 21 Topic 4021 of 4146
Post > Topic >>

Re: Scalable hash map: The defeat of lock-based synchronization

by "Dmitriy V'jukov" <dvyukov@[EMAIL PROTECTED] > Oct 2, 2008 at 03:32 AM

On Oct 2, 2:10=A0pm, Alexander Chemeris <alexander.cheme...@[EMAIL PROTECTED]
>
wrote:

> I think using rdtsc won't introduce too much distortion, even when
> timing small pieces of code. You can look into ffmpeg's timing
> facilities.
> Ffmpeg guys really do care about performance and have developed
> a good set of C macros for performance measurement.
>
> But, with current long-pipline CPUs there is a problem that you can't
> actually say that "this operation takes exactly N cycles". You have to
> clarify is it a number of cycles from the start of the first
> instruction
> to the start of the last instruction, or from the start of the first
> instruction
> to the end of the last instruction. If I recall correctly, using rdtsc
> for
> measuring every operation will give you the latter. While measuring
> the overall time will give you the former + loop overhead + context
> switches overhead. Probably context switches overhead is negligible
> because of the nature of experiment, but you can't get rid of loop
> overhead (though it should be just few cycles).
>
> So, in making story short - it would be interesting if you make
> timings on per-operation basis and compare that results with your
> previous results.

I agree that in the perfect world I have to make several extremely
precise measurements. But in real world I really don't have time to
make such things (I'm not a researcher, and nobody pays me for that).
Nevertheless I believe my measurements give precise results (but maybe
not very-very precise results). And I post source code, so everybody
is free to make any measurements he wants ;)
If we will take into consideration loop overhead and context switches
etc, well, maybe we will get 25 cycles/op instead of 30 cycles/op. I
think this is just inessential. This won't affect linear scaling of my
map, and super linear degradation of lock-based map.
As for rdtsc. When we are talking about things like 30 cycles, I think
rdtsc can introduce considerable distortion. Btw, when I was measuring
exact timings of some things I was using following scheme:

CPUID [eax=3D0]
t1 =3D RDTSC
CPUID [eax=3D0]
[tested code]
CPUID [eax=3D0]
t2 =3D RDTSC
CPUID [eax=3D0]
t =3D t2 - t1 - K

K must be determined experimentally so that t =3D 0 when [tested code]
is empty.
This allows one to measure timing down to individual instructions.

Dmitriy V'jukov
 




 21 Posts in Topic:
Scalable hash map: The defeat of lock-based synchronization
"Dmitriy V'jukov&quo  2008-09-12 12:47:42 
Re: Scalable hash map: The defeat of lock-based synchronization
"Dmitriy V'jukov&quo  2008-09-12 12:51:57 
Re: Scalable hash map: The defeat of lock-based synchronization
"Chris M. Thomasson&  2008-10-17 13:03:28 
Re: Scalable hash map: The defeat of lock-based synchronization
climber.cui@[EMAIL PROTEC  2008-09-13 08:25:04 
Re: Scalable hash map: The defeat of lock-based synchronization
climber.cui@[EMAIL PROTEC  2008-09-13 17:47:36 
Re: Scalable hash map: The defeat of lock-based synchronization
"Dmitriy V'jukov&quo  2008-09-15 04:16:01 
Re: Scalable hash map: The defeat of lock-based synchronization
Alexander Chemeris <al  2008-10-01 04:35:57 
Re: Scalable hash map: The defeat of lock-based synchronization
"Dmitriy V'jukov&quo  2008-10-01 04:58:51 
Re: Scalable hash map: The defeat of lock-based synchronization
Alexander Chemeris <al  2008-10-02 03:10:18 
Re: Scalable hash map: The defeat of lock-based synchronization
"Dmitriy V'jukov&quo  2008-10-02 03:32:41 
Re: Scalable hash map: The defeat of lock-based synchronization
"Chris M. Thomasson&  2008-10-19 21:09:50 
Re: Scalable hash map: The defeat of lock-based synchronization
demo <Tore.Halvorsen@[  2008-10-17 06:09:46 
Re: Scalable hash map: The defeat of lock-based synchronization
"Chris M. Thomasson&  2008-10-17 12:45:07 
Re: Scalable hash map: The defeat of lock-based synchronization
"Chris M. Thomasson&  2008-10-17 12:56:11 
Re: Scalable hash map: The defeat of lock-based synchronization
"Dmitriy V'jukov&quo  2008-10-17 15:46:46 
Re: Scalable hash map: The defeat of lock-based synchronization
"Dmitriy V'jukov&quo  2008-10-17 16:04:39 
Re: Scalable hash map: The defeat of lock-based synchronization
"Chris M. Thomasson&  2008-10-17 16:59:48 
Re: Scalable hash map: The defeat of lock-based synchronization
demo <Tore.Halvorsen@[  2008-10-19 23:56:44 
Re: Scalable hash map: The defeat of lock-based synchronization
demo <Tore.Halvorsen@[  2008-10-20 00:04:41 
Re: Scalable hash map: The defeat of lock-based synchronization
demo <Tore.Halvorsen@[  2008-10-20 00:28:50 
Re: Scalable hash map: The defeat of lock-based synchronization
"Dmitriy V'jukov&quo  2008-10-20 00:50:22 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Nov 22 9:36:53 CST 2008.