Git Product home page Git Product logo

Comments (8)

mdeboer avatar mdeboer commented on August 19, 2024 1

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.

mdeboer avatar mdeboer commented on August 19, 2024 1

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.

mdeboer avatar mdeboer commented on August 19, 2024 1

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.

alexislefebvre avatar alexislefebvre commented on August 19, 2024

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.

alexislefebvre avatar alexislefebvre commented on August 19, 2024

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.

alexislefebvre avatar alexislefebvre commented on August 19, 2024

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.

francoispluchino avatar francoispluchino commented on August 19, 2024

Just for information, for the Windows platform, the number of logical processors is already used.

from fastest.

mdeboer avatar mdeboer commented on August 19, 2024

Yes, just like for Linux 👍 It's just Mac that uses the physical processor count.

from fastest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.