Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by lifeformed · Jun 27, 2015 at 01:35 PM · performanceoptimizationplugindllc++

How do I get maximum performance on extremely heavy calculations?

My game starts out with a massive worldbuilding step that takes a very long time. Most of the heavy work involves a C# implementation of Box2D. It feels like there must be some overhead running this code in Unity when it doesn't really need to (it doesn't use much of Unity's API). I was wondering if it would be worth implementing some big chunks of my code in a separate DLL? Would it being unmanaged C++ help much at all? I'm sure it would help at least some, but it's a big task and I'd like to know if I could expect orders-of-magnitude improvement.

Are there other tricks I can do?

Ideally I'd like the CPU to be firing on all cylinders. Is there any way I can max out my CPU during this step, or is that more of an OS specific thing?

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image lifeformed · Jun 27, 2015 at 08:29 PM 0
Share

I will be for some aspects, but most of it is not very parallelizabe.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Dave-Carlile · Jun 27, 2015 at 01:42 PM

Unity is only using a single core, so if your world building algorithms can benefit from parallelism your best bet is probably threading.

Have you profiled the code and determined where the performance issues are? Identify those first before deciding how to optimize. Sometimes an algorithm change is what's called for instead of a new compiler.

And can you do your calculations in the background while showing an opening video? Or a progress screen that shows game hints? If we're talking about a minute or so, that's a viable option as well. Give the player something interesting to look at while they're waiting.

And is this something that happens every time the game starts? Or just when starting a new game? If the former, wouldn't you just do that the first time and save the results?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

C++ plugin for Unity “EntryPointNotFoundExeption” 0 Answers

return char** from C++ DLL 0 Answers

Import (mixed assembly) managed C++/CLI DLL plugin 0 Answers

Problem importing a mixed-mode (C++/CLI) library 2 Answers

Unity plugins 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges