Comments (8)
I think it’s not solely about the usage per core but also having a small queue “waiting”. The hyper threaded threads may not be as fast as a physical core but why waste a bit of cpu time when we can use it to create a thread and start testing. Then when the first thread on the core is done, there’s already one that can get our full attention and no time is wasted on garbage collection, starting a new thread and possibly fixtures.
I’ll cook up some numbers :)
from fastest.
Some results from a project that I'm working which is a Symfony 3.3 project with functional tests and database fixtures. I ran these tests on a Macbook Pro (2017) with dual-core i5 (2 physical cores, 4 logical cores with HT). I wrote a script to run these tests after clearing the cache and running it once to warm the (op)cache.
2 threads:
Test 1: Time: 18674 ms, Memory: 6291456 b
Test 2: Time: 17154 ms, Memory: 6291456 b
Test 3: Time: 17677 ms, Memory: 6291456 b
Average: 17835 ms
4 threads:
Test 1: Time: 13476 ms, Memory: 6291456 b
Test 2: Time: 13808 ms, Memory: 6291456 b
Test 3: Time: 14027 ms, Memory: 6291456 b
Average: 13770 ms
So yeah, that's 22.79% faster on average at least on this workload with over 90% of the tests being functional tests, requiring to bootstrap the whole application and load fixtures. I'll test this with some other projects that feature more unit tests to see if there's a difference when each test finishes a lot quicker.
from fastest.
You're welcome! 👍 I've heard that for gaming it's often preferred to have HT disabled so I guess it really depends on the workload.
Also I noticed that for linux you already count the logical number of CPU's by counting occurrences of processor
. In the text fixture it shows 4 processors which according to the Intel specs equal the logical number of cores. In each processor entry it also states "cpu cores: 2".
So yeah, things are a bit skewed now as for all platforms you use the number of logical processors except for OSX 😄
from fastest.
That's an interesting point. Hyperthreading offer about 30 % more power than the same core without Hyperthreading. If you launch two processes for two threads that are treated by one core, you're requiring a 200 % load while the CPU can only provide about 130 %.
I suggest you to compare time taken by tests when you use more or less threads with the --process
option. Could you please give us the results of your tests?
from fastest.
When I tested with one process per core vs. two processes per core, it looked like each test process was saturating one core, so there was no free resource for another process.
from fastest.
Thanks for the tests, these are good results!
IIRC tests took longer time with Hyperthreading, I tested it on a quad core / 8 processes i7 2 years ago. Too bah I didn't save the results of my experiment.
from fastest.
Just for information, for the Windows platform, the number of logical processors is already used.
from fastest.
Yes, just like for Linux 👍 It's just Mac that uses the physical processor count.
from fastest.
Related Issues (20)
- support of PHP 7.3 HOT 7
- Test names are not aligned with -vv when some tests take minutes and other seconds HOT 4
- Behat tests never end HOT 10
- use input list in inverse mode HOT 5
- generating the list of tests from a PHPUnit XML file ignores the <groups> tag
- Always a false positive HOT 1
- symfony 5 HOT 5
- Incompatible with laravel HOT 3
- before option not working anymore HOT 10
- How to run two commands before tests? HOT 1
- Not compatible with PHPUnit 9+ HOT 2
- Switch to GitHub actions
- Add support for MongoDB official client HOT 4
- Failure on several issues HOT 4
- Latest Symfony Process make fastest screaming with PHP Warning: Array to string conversion HOT 19
- Symfony 5.4 phpunit 9.5 with forceCoversAnnotation and beStrictAboutCoversAnnotation giving random failures HOT 2
- Support for DATABASE_URL HOT 8
- Question about database isolation HOT 3
- Update symfony dependencies to ^6.0 HOT 5
- Couldn't make it run with WordPress HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fastest.