bazhenov / tango

Rust microbenchmarking harness based on paired-testing methodology
MIT License
72 stars 1 forks source link

Randomize order #24

Closed FilipAndersson245 closed 6 months ago

FilipAndersson245 commented 6 months ago

I had the idea that maybe we should randomize the order of the time measurement. instead of abababababababab

we may have abbaababbababaab

this to reduce any bias that a is run before b etc.

bazhenov commented 6 months ago

Actually this was the case in tango prior to version 0.3. I removed this functionality because of 2 following considerations:

FilipAndersson245 commented 6 months ago

Okay, did not try out the -p flag as it did not have any documentation with -h. Would it not introduce a bias if the work is executed on two different thread, in theory one could be allocated on a efficiency core and one on a performance core (eg intel).

bazhenov commented 6 months ago

Would it not introduce a bias if the work is executed on two different thread, in theory one could be allocated on a efficiency core and one on a performance core (eg intel).

Yes and no. P/E core scheduling is not an issue in my experience. In practice scheduler priority class is usually given to a thread at startup and doesn't change after. The more important issue might be the core allocation itself. Even if both threads are on P-cores it might be the case that one thread is allocated to a core pinned for system activity (like handling IRQs). In this case it will be a bias. This is why it is opt-in behavior.