Jump to content

Is Unity 5 a very multi threaded application?

DeadlyPilot

 

Tried posting this on Unity's site but their forums are dead and useless..

 

Say I wanna build a PC for the sole purpose of developing on Unity. How many cores will Unity utilize? Would I want to buy a CPU with better single thread or multi thread performance? I don't mean the amount of threads my games can be written to use, but the Unity Editor itself. Say I want the best performance when working on projects.

Link to comment
Share on other sites

Link to post
Share on other sites

Unity is single-threaded and multi-threaded and how many cores it uses is dependent on your programming and parameters. Most of the physics inside of Unity are still single-threaded. 

Cor Caeruleus Reborn v6

Spoiler

CPU: Intel - Core i7-8700K

CPU Cooler: be quiet! - PURE ROCK 
Thermal Compound: Arctic Silver - 5 High-Density Polysynthetic Silver 3.5g Thermal Paste 
Motherboard: ASRock Z370 Extreme4
Memory: G.Skill TridentZ RGB 2x8GB 3200/14
Storage: Samsung - 850 EVO-Series 500GB 2.5" Solid State Drive 
Storage: Samsung - 960 EVO 500GB M.2-2280 Solid State Drive
Storage: Western Digital - Blue 2TB 3.5" 5400RPM Internal Hard Drive
Storage: Western Digital - BLACK SERIES 3TB 3.5" 7200RPM Internal Hard Drive
Video Card: EVGA - 970 SSC ACX (1080 is in RMA)
Case: Fractal Design - Define R5 w/Window (Black) ATX Mid Tower Case
Power Supply: EVGA - SuperNOVA P2 750W with CableMod blue/black Pro Series
Optical Drive: LG - WH16NS40 Blu-Ray/DVD/CD Writer 
Operating System: Microsoft - Windows 10 Pro OEM 64-bit and Linux Mint Serena
Keyboard: Logitech - G910 Orion Spectrum RGB Wired Gaming Keyboard
Mouse: Logitech - G502 Wired Optical Mouse
Headphones: Logitech - G430 7.1 Channel  Headset
Speakers: Logitech - Z506 155W 5.1ch Speakers

 

Link to comment
Share on other sites

Link to post
Share on other sites

1 minute ago, ARikozuM said:

Unity is single-threaded and multi-threaded and how many cores it uses is dependent on your programming and parameters. Most of the physics inside of Unity are still single-threaded. 

Then I'd go for an i7, since they generally have a high clock, good for single core tasks, but still have 8 threads for multithreaded workloads. 

Intel HEDT and Server platform enthusiasts: Intel HEDT Xeon/i7 Megathread 

 

Main PC 

CPU: i9 7980XE @4.5GHz/1.22v/-2 AVX offset 

Cooler: EKWB Supremacy Block - custom loop w/360mm +280mm rads 

Motherboard: EVGA X299 Dark 

RAM:4x8GB HyperX Predator DDR4 @3200Mhz CL16 

GPU: Nvidia FE 2060 Super/Corsair HydroX 2070 FE block 

Storage:  1TB MP34 + 1TB 970 Evo + 500GB Atom30 + 250GB 960 Evo 

Optical Drives: LG WH14NS40 

PSU: EVGA 1600W T2 

Case & Fans: Corsair 750D Airflow - 3x Noctua iPPC NF-F12 + 4x Noctua iPPC NF-A14 PWM 

OS: Windows 11

 

Display: LG 27UK650-W (4K 60Hz IPS panel)

Mouse: EVGA X17

Keyboard: Corsair K55 RGB

 

Mobile/Work Devices: 2020 M1 MacBook Air (work computer) - iPhone 13 Pro Max - Apple Watch S3

 

Other Misc Devices: iPod Video (Gen 5.5E, 128GB SD card swap, running Rockbox), Nintendo Switch

Link to comment
Share on other sites

Link to post
Share on other sites

9 minutes ago, Zando Bob said:

Then I'd go for an i7, since they generally have a high clock, good for single core tasks, but still have 8 threads for multithreaded workloads. 

For development, I would suggest a Ryzen octacore so that he can test and debug in real-time without bogging the system down. 

 

@DeadlyPilot Make a build with an i7 hexacore and an R7-1700 and see which offers the most for the money. 

Cor Caeruleus Reborn v6

Spoiler

CPU: Intel - Core i7-8700K

CPU Cooler: be quiet! - PURE ROCK 
Thermal Compound: Arctic Silver - 5 High-Density Polysynthetic Silver 3.5g Thermal Paste 
Motherboard: ASRock Z370 Extreme4
Memory: G.Skill TridentZ RGB 2x8GB 3200/14
Storage: Samsung - 850 EVO-Series 500GB 2.5" Solid State Drive 
Storage: Samsung - 960 EVO 500GB M.2-2280 Solid State Drive
Storage: Western Digital - Blue 2TB 3.5" 5400RPM Internal Hard Drive
Storage: Western Digital - BLACK SERIES 3TB 3.5" 7200RPM Internal Hard Drive
Video Card: EVGA - 970 SSC ACX (1080 is in RMA)
Case: Fractal Design - Define R5 w/Window (Black) ATX Mid Tower Case
Power Supply: EVGA - SuperNOVA P2 750W with CableMod blue/black Pro Series
Optical Drive: LG - WH16NS40 Blu-Ray/DVD/CD Writer 
Operating System: Microsoft - Windows 10 Pro OEM 64-bit and Linux Mint Serena
Keyboard: Logitech - G910 Orion Spectrum RGB Wired Gaming Keyboard
Mouse: Logitech - G502 Wired Optical Mouse
Headphones: Logitech - G430 7.1 Channel  Headset
Speakers: Logitech - Z506 155W 5.1ch Speakers

 

Link to comment
Share on other sites

Link to post
Share on other sites

4 minutes ago, ARikozuM said:

For development, I would suggest a Ryzen octacore so that he can test and debug in real-time without bogging the system down. 

 

@DeadlyPilot Make a build with an i7 hexacore and an R7-1700 and see which offers the most for the money. 

Though if he's doing a lot of single-core work, the i7 7700K is much faster than an R7 1700. Though the Ryzen is a lot more bang for the buck and will still fly through almost any task.

Intel HEDT and Server platform enthusiasts: Intel HEDT Xeon/i7 Megathread 

 

Main PC 

CPU: i9 7980XE @4.5GHz/1.22v/-2 AVX offset 

Cooler: EKWB Supremacy Block - custom loop w/360mm +280mm rads 

Motherboard: EVGA X299 Dark 

RAM:4x8GB HyperX Predator DDR4 @3200Mhz CL16 

GPU: Nvidia FE 2060 Super/Corsair HydroX 2070 FE block 

Storage:  1TB MP34 + 1TB 970 Evo + 500GB Atom30 + 250GB 960 Evo 

Optical Drives: LG WH14NS40 

PSU: EVGA 1600W T2 

Case & Fans: Corsair 750D Airflow - 3x Noctua iPPC NF-F12 + 4x Noctua iPPC NF-A14 PWM 

OS: Windows 11

 

Display: LG 27UK650-W (4K 60Hz IPS panel)

Mouse: EVGA X17

Keyboard: Corsair K55 RGB

 

Mobile/Work Devices: 2020 M1 MacBook Air (work computer) - iPhone 13 Pro Max - Apple Watch S3

 

Other Misc Devices: iPod Video (Gen 5.5E, 128GB SD card swap, running Rockbox), Nintendo Switch

Link to comment
Share on other sites

Link to post
Share on other sites

You can overclock an i7 7700K to about 4.8 - 5.0 gHz (if you're lucky). You can overclock Ryzen 7 1700 to about 3.8 (and even 4.0) gHz and it's cheaper and has 4 more cores. I think 4 more cores of Ryzen 7 will give you larger performance boost than 1gHz more on the i7 7700K.

Try, fail, learn, repeat...

Link to comment
Share on other sites

Link to post
Share on other sites

9 hours ago, DeadlyPilot said:

 

 

9 hours ago, ARikozuM said:

Unity is single-threaded and multi-threaded and how many cores it uses is dependent on your programming and parameters. Most of the physics inside of Unity are still single-threaded. 

I'm a bit confused. So the games that I write in Unity can use as many threads as I optimize them to, but as far as the editor itself when developing and debugging games, it uses more than a single thread right?

Link to comment
Share on other sites

Link to post
Share on other sites

11 minutes ago, DeadlyPilot said:

 

I'm a bit confused. So the games that I write in Unity can use as many threads as I optimize them to, but as far as the editor itself when developing and debugging games, it uses more than a single thread right?

Single-thread doesn't mean that it uses one core. Battlefield 1 uses multiple cores, right? 

Does that mean that it's a multi-threaded application? NO!

 

BF1 has a lot more single-threaded functions as opposed to multi-threaded, but can offset them among many cores. A single-threaded task cannot be shared between cores and HT/SMT only schedules the 2nd task for when the 1st is complete. Multi-threaded functions are split into pieces as they may not rely on incredibly precise calculations or can be done in pieces allowing them to later be approximated. You can assign a number of cores to your program, but you won't be able to make it wholly single-threaded unless you want a bullet hitting something behind a wall because Core 2 didn't complete the wall penetration calculation fast enough or you want bullets that decide "coffee breaks" are entirely appropriate in mid-air by utilizing a pause parameter so that Core 2 can finish and send its work to the master core. 

 

TL;DR: Leveraging multiple cores does not make an engine multi-threaded. HT/SMT do not add more cores to your system since they themselves don't perform calculations but rather hold them. 

Cor Caeruleus Reborn v6

Spoiler

CPU: Intel - Core i7-8700K

CPU Cooler: be quiet! - PURE ROCK 
Thermal Compound: Arctic Silver - 5 High-Density Polysynthetic Silver 3.5g Thermal Paste 
Motherboard: ASRock Z370 Extreme4
Memory: G.Skill TridentZ RGB 2x8GB 3200/14
Storage: Samsung - 850 EVO-Series 500GB 2.5" Solid State Drive 
Storage: Samsung - 960 EVO 500GB M.2-2280 Solid State Drive
Storage: Western Digital - Blue 2TB 3.5" 5400RPM Internal Hard Drive
Storage: Western Digital - BLACK SERIES 3TB 3.5" 7200RPM Internal Hard Drive
Video Card: EVGA - 970 SSC ACX (1080 is in RMA)
Case: Fractal Design - Define R5 w/Window (Black) ATX Mid Tower Case
Power Supply: EVGA - SuperNOVA P2 750W with CableMod blue/black Pro Series
Optical Drive: LG - WH16NS40 Blu-Ray/DVD/CD Writer 
Operating System: Microsoft - Windows 10 Pro OEM 64-bit and Linux Mint Serena
Keyboard: Logitech - G910 Orion Spectrum RGB Wired Gaming Keyboard
Mouse: Logitech - G502 Wired Optical Mouse
Headphones: Logitech - G430 7.1 Channel  Headset
Speakers: Logitech - Z506 155W 5.1ch Speakers

 

Link to comment
Share on other sites

Link to post
Share on other sites

2 minutes ago, ARikozuM said:

Single-thread doesn't mean that it uses one core. Battlefield 1 uses multiple cores, right? 

Does that mean that it's a multi-threaded application? NO!

 

BF1 has a lot more single-threaded functions as opposed to multi-threaded, but can offset them among many cores. A single-threaded task cannot be shared between cores and HT/SMT only schedules the 2nd task for when the 1st is complete. Multi-threaded functions are split into pieces as they may not rely on incredibly precise calculations or can be done in pieces allowing them to later be approximated. You can assign a number of cores to your program, but you won't be able to make it wholly single-threaded unless you want a bullet hitting something behind a wall because Core 2 didn't complete the wall penetration calculation fast enough or you want bullets that decide "coffee breaks" are entirely appropriate in mid-air by utilizing a pause parameter so that Core 2 can finish and send its work to the master core. 

 

TL;DR: Leveraging multiple cores does not make an engine multi-threaded. HT/SMT do not add more cores to your system since they themselves don't perform calculations but rather hold them. 

Right, just cause it can use multiple threads doesn't mean it will fully utilize each and every one. I'm just wondering up to how many threads the Unity 5 editor will fully utilize, not so much how many threads my games themselves will fully utilize. 

 

Also, your basically saying HT and multi threading basically prepares one task to be calculated after the one ahead finishes? How is this faster than a single thread on each core?

Link to comment
Share on other sites

Link to post
Share on other sites

Software development can be either slightly threaded or heavily threaded depending on what you're doing specifically.  I can't speak for Unity, but Unreal Engine has a lot going on and having additional cores/threads AND higher clock speeds is definitely a benefit.  Also, keep in mind that if you're going to do any kind of art (3D rendering/modeling) or any kind of virtualization that having good multi-threaded performance is going to be a huge benefit.

 

Bare minimum you'll want a decent i7 and it may be worth considering Ryzen as well.  I definitely prefer Intel for my rigs since I mostly game at home and develop at work, but this is one of the cases when team Red having the better threaded performance for a decent price is worth looking at.

Link to comment
Share on other sites

Link to post
Share on other sites

@DeadlyPilot My Android cut half of my response out.

 

HT schedules a thread/function for faster access once the first function is done. HT doesn't do any calculations itself.

 

The Editor itself uses every core you can likely throw at it. Obviously, you shouldn't overspend on a 20-core CPU if you're dropping frequency for those cores. I would look into an octacore from the Ryzen line-up since they can offer you as many cores as you'd like without dropping frequency like an anchor.

Cor Caeruleus Reborn v6

Spoiler

CPU: Intel - Core i7-8700K

CPU Cooler: be quiet! - PURE ROCK 
Thermal Compound: Arctic Silver - 5 High-Density Polysynthetic Silver 3.5g Thermal Paste 
Motherboard: ASRock Z370 Extreme4
Memory: G.Skill TridentZ RGB 2x8GB 3200/14
Storage: Samsung - 850 EVO-Series 500GB 2.5" Solid State Drive 
Storage: Samsung - 960 EVO 500GB M.2-2280 Solid State Drive
Storage: Western Digital - Blue 2TB 3.5" 5400RPM Internal Hard Drive
Storage: Western Digital - BLACK SERIES 3TB 3.5" 7200RPM Internal Hard Drive
Video Card: EVGA - 970 SSC ACX (1080 is in RMA)
Case: Fractal Design - Define R5 w/Window (Black) ATX Mid Tower Case
Power Supply: EVGA - SuperNOVA P2 750W with CableMod blue/black Pro Series
Optical Drive: LG - WH16NS40 Blu-Ray/DVD/CD Writer 
Operating System: Microsoft - Windows 10 Pro OEM 64-bit and Linux Mint Serena
Keyboard: Logitech - G910 Orion Spectrum RGB Wired Gaming Keyboard
Mouse: Logitech - G502 Wired Optical Mouse
Headphones: Logitech - G430 7.1 Channel  Headset
Speakers: Logitech - Z506 155W 5.1ch Speakers

 

Link to comment
Share on other sites

Link to post
Share on other sites

On 6/19/2017 at 6:09 PM, DeadlyPilot said:

Also, your basically saying HT and multi threading basically prepares one task to be calculated after the one ahead finishes? How is this faster than a single thread on each core?

HyperThreading enables a single core to allow another thread to use unused execution resources if the one its working on doesn't use them. For example, if one thread needs only the integer ALU for its work, another thread that only needs the FPU can be executed on the core at the same time.

 

Or to put it in another way, say you're working on some craft project that involves cutting and gluing. However, there's only enough scissors and glue to go around for two people to have one of each. So you pair up. But chances are you both won't be needing the scissors or the glue at the same time, so while one cuts, the other glues.

Link to comment
Share on other sites

Link to post
Share on other sites

It's funny how you're all answering the wrong question.

OP, the Editor itself should be ok to run on a 4-core system, with or without HT/MT. Compiling code is a bit of a different story, where the more cores/threads the better. I'd focus more on utilizing a SSD to load projects.

CPU - Ryzen 7 3700X | RAM - 64 GB DDR4 3200MHz | GPU - Nvidia GTX 1660 ti | MOBO -  MSI B550 Gaming Plus

Link to comment
Share on other sites

Link to post
Share on other sites

Two recommendations for working with Unity: 

 

Get a big SSD, really, loading and compiling a project benefits greatly from this. 

 

Go for the best CPU you can afford. Again, compiling all the assets and scripts benefit greatly from a multi core cpu. 

 

source: Me, working with Unity for VR projects in the last year and a half. 

Link to comment
Share on other sites

Link to post
Share on other sites

On 6/20/2017 at 3:01 AM, ARikozuM said:

Single-thread doesn't mean that it uses one core. Battlefield 1 uses multiple cores, right? 

Does that mean that it's a multi-threaded application? NO!

 

BF1 has a lot more single-threaded functions as opposed to multi-threaded, but can offset them among many cores. A single-threaded task cannot be shared between cores and HT/SMT only schedules the 2nd task for when the 1st is complete. Multi-threaded functions are split into pieces as they may not rely on incredibly precise calculations or can be done in pieces allowing them to later be approximated. You can assign a number of cores to your program, but you won't be able to make it wholly single-threaded unless you want a bullet hitting something behind a wall because Core 2 didn't complete the wall penetration calculation fast enough or you want bullets that decide "coffee breaks" are entirely appropriate in mid-air by utilizing a pause parameter so that Core 2 can finish and send its work to the master core. 

 

TL;DR: Leveraging multiple cores does not make an engine multi-threaded. HT/SMT do not add more cores to your system since they themselves don't perform calculations but rather hold them. 

I do not agree with you, especially your BF1 example.

Frostbite, like most engines these days (see GDC presentations of Naughty Dog and Bungie), uses a task/job graph to schedule tasks over multiple cores.

The task system launches a bunch of threads at the start of the program, after which they use an internal taks system to schedule jobs (usually using function pointers although Naughty Dog uses fibers (cool stuff)).

They do this because creating and closing threads has a relatively high overhead (creating/closing threads takes "a lot of" time).

 

This is certainly multi-threading (multiple tasks are executed in parallel).

 

Also, like Yurizaki said, hyper threading introduces extra  "helper" cores which can use unused execution resources.

So they do execute their work in parallel with the "main" cores.

Desktop: Intel i9-10850K (R9 3900X died 😢 )| MSI Z490 Tomahawk | RTX 2080 (borrowed from work) - MSI GTX 1080 | 64GB 3600MHz CL16 memory | Corsair H100i (NF-F12 fans) | Samsung 970 EVO 512GB | Intel 665p 2TB | Samsung 830 256GB| 3TB HDD | Corsair 450D | Corsair RM550x | MG279Q

Laptop: Surface Pro 7 (i5, 16GB RAM, 256GB SSD)

Console: PlayStation 4 Pro

Link to comment
Share on other sites

Link to post
Share on other sites

Unity says it depends on your workload. 

Ive used unity on a 16 or 24 thread xeon with 32 gb of ram of which the system ran beautifully I cannot say how many cored it utilized however I've seen people develop on laptop i5s and even surface tablets. The biggest concern id have is 8gb or 16 gb of ram. On my dual thread laptop i7 3000 series I was doing exceptonally well in 3D. I made an FPS game with up to 7 animated AI running and shooting projectiles running really well in development on all sorts of systems with custom assets in 100^2 unit environments using the editor. 

 

If youre just building a PC to start game development, build a gaming pc and you'll be plenty fine. My i5 3450 is more than enough with 4 threads. 

 

For a pc recommendation, 

i5/ryzen 5 or better

6 gb of ram or better

integrated graphics minimum, 750 ti or better

plenty of HDD space for projects. 

 

Have you had ACTUAL problems on your current pc? If so try opening unity again and see what's slow after the editor and script editor are open. 

 

If you have a 64 bit system make sure you have 64 bit OS and 64 bit Unity. It works beautifully on the big 3. (Windows(8 and 10 personally tested), Mac(i5 2013 iMac model personally tested), Linux-Ubuntu and Lubuntu personally tested.) 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×