SkrDrag commented on issue #2516:
URL:
https://github.com/apache/incubator-hugegraph/issues/2516#issuecomment-2049589772
> 2\. `System.currentTimeMillis()` for CPU time and calculate memory usage
by subtracting free memory from total memory using `Runtime.getRuntime()`.
Insert these measurements at critical points in the algorithm's execution path
and log the results for analysis.
>
> Example code snippet for manual instrumentation:
>
> ```java
> long startTime = System.currentTimeMillis();
> long startMemory = Runtime.getRuntime().totalMemory() -
Runtime.getRuntime().freeMemory();
>
> // Algorithm execution code
>
> long endTime = System.currentTimeMillis();
> long endMemory = Runtime.getRuntime().totalMemory() -
Runtime.getRuntime().freeMemory();
>
> LOG.debug("Execution time: " + (endTime - startTime) + "ms");
> LOG.debug("Memory used: " + (endMemory - startMemory) + " bytes");
> ```
>
> 3. **Java Microbenchmark Harness (JMH)**: For detailed performance
analysis, integrate JMH to benchmark th
修改代码,编译运行之后,输出的log文件应该在哪个目录下
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]