Measure performance for overriden methods
See original GitHub issueHi. I have following scenario.
class Parent
{
[Time]
virtual SomeMethod()
}
In some cases I need to override SomeMethod as below and measure performance.
class Child:Parent
{
[Time]
override SomeMethod()
}
How can I only keep only overriden method’s performance data.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Performance of Overriding vs. if-statement - java
A class which does nothing; A subclass that is doing the output ; Is the Java lookup of the method to call faster...
Read more >measure(_:) | Apple Developer Documentation
Override defaultPerformanceMetrics to change the default metrics measured by this method. Note. This method starts and stops performance measurement ...
Read more >Increasing Performance by Reducing Dynamic Dispatch
The dynamic calls are necessary because a subclass of ParticleModel might override point or velocity with a computed property or override ...
Read more >Measure Java Performance - Sampling or Instrumentation?
It turns out there are actually a few established methods for measuring by adding measurement code: Manually add some System.out.println code for important ......
Read more >Boosting Performance With Sealed Classes in .NET
Let's see how sealed classes help us in boosting performance in C# ... Again, we inherit from the Animal class and override the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
About 2: yes, you can create your own implementation and keep track of the calls that were recently made (e.g. a number of last 10 items). But if I am using MethodTimer, I am interested in both the overridden and base implementation behavior (timing).
If you are only interested in the “overall” time of the method, you could create a non-virtual method that you time, and don’t time the virtual and overridden method. In this case you will always get the “total time”, no matter whether it was overridden or not.
public static void Log(MethodBase methodBase, TimeSpan elapsed)
you mean we can somehow check inside this method that methodBase was overriden and base call performed?