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 private void · Jul 21, 2013 at 02:49 AM · performanceoptimizationefficiency

What slows down my game?

Hi, This is gonna be a very general / conceptual question so please tell me if I should move this to the forum.

I want to learn how to optimize my game in terms of efficiency. The things I want to learn is:

  • Which is costly: Memory or computation?

  • Accessing a public variable of another script in Update, or storing it into a local variable and use it?

  • Few long functions or more short functions? Or does it not matter?

  • Public variables or private variables?

Where can I find answers to such questions? Thanks !

Comment
Add comment · Show 3
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 Dave-Carlile · Jul 21, 2013 at 02:50 AM 0
Share

Discussion questions like this should take place in the forums.

avatar image dorpeleg · Jul 21, 2013 at 06:51 AM 0
Share

Yes, @Dave_Carlile is right.

Unless you have a specific performance issue, then post this on the forums.

If you do post it on the forums, please close this question.

avatar image private void · Jul 21, 2013 at 12:35 PM 1
Share

Well, for now I found my answer. If necessary, moderators can delete this question. (I'm allowing them :D )

1 Reply

· Add your reply
  • Sort: 
avatar image
0
Best Answer

Answer by IgorAherne · Jul 21, 2013 at 07:18 AM

http://wiki.unity3d.com/index.php/General_Performance_Tips

nuff said :D

Comment
Add comment · Show 2 · 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
avatar image private void · Jul 21, 2013 at 12:35 PM 0
Share

Yes this is good. Thanks !

avatar image private void · Jul 21, 2013 at 12:37 PM 0
Share

Especially the line "Don't use methods which search for objects any more than is necessary. This includes methods such as GameObject.FindByTag() and GameObject.GetComponent(), as well as all the component convenience properties (transform, light, etc.). These methods are optimised to operate as quickly as possible, but they still have to search through all the relevant objects to find the one you want. The most important thing is to avoid calling search methods repeatedly in Update() or FixedUpdate(). Ins$$anonymous$$d, call the method once, store its result in a member variable of your class, and then use the member variable to access it the next time you need it." really is my answer. Plus one for this :D

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

18 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Particle System Optimization (.IsAlive but more efficient) 1 Answer

Are there any performance differences between a timer and using Invoke? 1 Answer

Reasonable heap alloc. per second and total ? 0 Answers

a ton of sprites vs sprite-tiling on one object 0 Answers

Efficient mesh vertex count changes? 1 Answer


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