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
2
Question by davedev · Mar 22, 2012 at 08:36 PM · profilerfunctions

Use Deep Profile to Profile Functions?

Is it possible to use Deep Profile to determine the time to execute specific functions in Profiler? When I try Deep Profile in Profiler I get a profile for my Update functions, but within that I only get times for "StackTraceUtility.PostProcessStacktrace()" and not for the functions contained in Update.

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 syclamoth · Mar 22, 2012 at 08:46 PM 2
Share

Comment out your debug. Debug logging can be disproportionately expenseive at times.

avatar image davedev · Mar 23, 2012 at 01:10 PM 0
Share

Thanks. That actually fixes my problem and removes my immediate need to profile specific functions though it be good to find out if that's possible.

avatar image JChilton · Nov 26, 2012 at 05:24 PM 0
Share

Just wanted to add that this fixed my issue as well. Debug.drawline gets expensive very fast during grid pathfinding. Navigating a small 20x20 grid took 600ms a call because of all the logging.

1 Reply

· Add your reply
  • Sort: 
avatar image
6

Answer by Statement · Mar 23, 2012 at 03:20 PM

You can provide bits of code with a specific label if you have access to the source code. This allow you to get more control about what is displayed in the profiler.

 Profiler.BeginSample ("MyPieceOfCode");
 // do something that takes a lot of time
 Profiler.EndSample ();

Comment
Add comment · Show 3 · 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 v01pe_ · Aug 17, 2015 at 02:15 PM 0
Share

Now found here: http://docs.unity3d.com/ScriptReference/Profiler.BeginSample.html

avatar image Statement · Aug 17, 2015 at 06:59 PM 0
Share

Thanks, updated the link.

avatar image IgorAherne · Jan 26, 2017 at 10:57 PM 2
Share

broken link, here is fresh: https://docs.unity3d.com/ScriptReference/Profiling.Profiler.BeginSample.html

By the way, I couldn't get it to work like the docs are saying. Even with "using UnityEngine", I had to call UnityEngine.Profiling.Profiler to be able to invoke it

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

8 People are following this question.

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

Related Questions

Documentation for Profiler functions? 1 Answer

Unity profiler Gfx.WaitForPresentOnGfxThread 2 Answers

Andriod (Oculus Quest 2 app) locked at 30 fps 1 Answer

How do I call a function containing a while loop, inside the update function? 2 Answers

Changing the color of a block when a player walks on it? 2 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