Some of the platforms I'm developing do not have profiling tools. I am looking for suggestions / methods that you personally used to help you identify hot spots, without using a profiler.
The final language is C ++.
I'm interested in what you personally used.
I found the following quite useful:
#ifdef PROFILING # define PROFILE_CALL(x) do{ \ const DWORD t1 = timeGetTime(); \ x; \ const DWORD t2 = timeGetTime(); \ std::cout << "Call to '" << #x << "' took " << (t2 - t1) << " ms.\n"; \ }while(false) #else # define PROFILE_CALL(x) x #endif
What can be used in the calling function as such:
PROFILE_CALL(renderSlow(world)); int r = 0; PROFILE_CALL(r = readPacketSize());
. std:: cout , /, Beep(). -, "Beep", .
. rgb (255,0,0) .
, / Beeps , , , , , .. , .
, , , . , , , , , / .
, / / , , . , , . , , .
, , , , .
- (, ), , , , , (, 10 , , - !). , , ..
, , , / .
80/20 . , (, , ), , (QueryPerformanceCounters, gettimeofday ..).
- ( ) " ", , - . , sinks/srcs (sinks moreso), , (, ) .
Visual Studio?
/Gh /GH.
, -, , , / .
Then you can log all profiling data, not just time information. Stack-dumps, call address, return address, etc. This is important because you may know that “function X uses Y-time under function Z” and not just the total time spent on function X.
Source: https://habr.com/ru/post/1699493/More articles:Is there a way to “hide” a JavaScript file from IntelliSense in Visual Studio 2008? - javascriptHow to save a database with associations in rails protecting mass assignment - ruby | fooobar.comPowerShell, уступающий ОС в жестких циклах - powershellDoes the operator adjust a decent style? - coding-styleRelaxNG (rnc) schema for XHTML extension - xhtmlКак проверить, что строка содержит только международные буквы и пробелы в UTF8 в PHP? - phpHow to automate the tasks of releasing open source software? - open-sourceAm I missing something, or do varargs violate Arrays.asList? - javaWPF application development - any way to optimize a .NET installation? - c #How to force PHP to use UTF-8 encoding - htmlAll Articles