Questions tagged [profiling]

38 questions
24
votes
11 answers

Is it always wrong to optimize before profiling?

I see the mantra of "profiling before optimization" repeated again and again here, on SO, and elsewhere. Although I certainly use profiling tools, I'm only occasionally surprised by the results. It seems like, as often as not, the profiler is just…
Cercerilla
  • 1,969
  • 11
  • 14
11
votes
1 answer

How to see what parts of your code are run most often?

I would like to be able to see what code in thousands of lines of source code is run most often and takes the longest. The purpose of this would be for optimization. Being able to see what parts of the code are run most often is important for…
sinθ
  • 1,311
  • 15
  • 25
10
votes
4 answers

How to find bottlenecks in an application?

I'm building an application with lots of components, a lot of which are third-party so I only know what I can get from their documentation. From time to time, by pure luck, I find out one of these components was pretty heavy and had an option to…
ChocoDeveloper
  • 393
  • 1
  • 4
  • 14
9
votes
11 answers

Where do you optimize?

There are two areas to possibly optimize for speed in: Where the most time is spent The code that is called the most Which is the best place to start optimizing? Often code that is called the most often has low execution times already. Do you…
Michael K
  • 15,539
  • 9
  • 61
  • 93
9
votes
2 answers

Determining Cost of API Calls

[This is a cross-post originally posted by me in SO. I think the question is more appropriate here.] I was going through the adwords API and came across their rate sheet - http://code.google.com/apis/adwords/docs/ratesheet.html . They charge $0.25…
Sam
  • 231
  • 1
  • 2
  • 8
8
votes
5 answers

Does profiling without benchmarking lead to micro-optimization?

Read first: For a definition of the two terms ("profiling" and "benchmarking") and the need for distinguishing them, please read this answer to a previous question. I have to admit that until I saw Winston Ewert's answer, I have never thought of the…
rwong
  • 16,695
  • 3
  • 33
  • 81
8
votes
1 answer

How can I optimize a program's performance when no profiling tools are available?

I am currently working on an OpenGl program whose performance I would like to improve. The performance is okay but not ideal on powerful dedicated GPUs, but is abysmal on integrated graphics (< 10 fps). In a normal program (CPU-based, no OpenGl or…
john01dav
  • 879
  • 1
  • 7
  • 14
8
votes
2 answers

Do I get valid profiling results with optimization turned off?

I use perf to profile my application. To make interpretation of the resulting call graph easier, I partitioned my core loops using label functions like maptable_appendRange that can be easily searched for in the call graph. Unfortunately, these…
Johannes Luong
  • 356
  • 2
  • 8
7
votes
2 answers

When profiling a function for time use, what information is desirable?

I'm writing a program similar to Python's timeit module. The idea is to time a function by executing it anywhere from 10 to 100,000 times depending on how long it takes and then report results. I've read that the most important number is the minimum…
aaronasterling
  • 375
  • 1
  • 9
6
votes
1 answer

Conditional attribute in XML - most concise solution?

I am tasked with setting up conditional profiling - a method of tagging chunks of XML with an attribute, which will then be used as a conditional value to extract subset of that XML. Have a look at another definition/example: DITA profiling The XML…
6
votes
4 answers

Interpreting gprof profiling output

I am practicing algorithm and data structures. Therefore, I keep profiling my programs. Here is an example output from gprof: Each sample counts as 0.01 seconds. % cumulative self self total time seconds …
yasar
  • 185
  • 1
  • 6
5
votes
1 answer

Is Node.js correct choice for JSON parsing and IO driven

My program should perform following task: It listen on http port after getting request it does following things. Connect to gearman Parse gearman payload to JSON (Upto 100 bytes) Connect to Redis Parse redis payload to JSON (256 bytes to 10KB.…
Vivek Goel
  • 159
  • 1
  • 7
5
votes
1 answer

Use of a profiler tool to aid in the analysis of a brute force algorithm in Java

I was asked to profile (using some tool, such as YourKit or JVisualVM) a couple of implementations of the Traveling Salesman Problem (find the minimum path that visits all the given set of cities), in the context of a Algorithms Analysis and Design…
devoured elysium
  • 592
  • 1
  • 5
  • 17
5
votes
6 answers

How should I react to diminishing application performance?

Sometimes it comes to me that the biggest challenge for an engineer when he find his application getting worse in performance is lack of enough information. Imagine that you go through the weekly performance report from your application's access…
Vance
  • 343
  • 1
  • 3
  • 9
5
votes
6 answers

Is there any value in knowing the execution time for a unit test?

Is the execution time of a unit test useful for anything? Is a unit test an appropriate place for any sort of code profiling? Why or why not? Sample Use Case: Every unit test lists name, pass/fail, and execution time. Time is also calculated per…
Curious Query
  • 53
  • 1
  • 4
1
2 3