79281560

Date: 2024-12-14 23:21:41
Score: 1
Natty:
Report link

First of all, your code/project is way too big in my opinion for someone to retry and give a concise answer to your several questions, which may amount to redoing it for you.

Regarding to your questions, it's not quite clear what's your issue, but I suppose you're concerned more about the "average" times that you are observing while running your Java and C++ implementations. In this regards, I would like to draw your attention to the "max" value of your first "PUT", which is way too big for C++, and it requires further and thorough analysis.

Concerning to Java and C++ compilers, to my knowledge Java is much more optimized for performance than any other C++ compiler can do out-of-the box. That being said, it doesn't mean that C++ can't beat Java in terms of performance. It certainly can, but it also requires some more care from the developers, for example by adding couple of more const keywords or applying some other syntactic formalities.

Generally, to optimize any software for performance, one shall first understand what are the bottlenecks and which parts are the most time-consuming. Let alone the benchmarking techniques and language-specifics, you should not compare apples with oranges, which you are doing here in my opinion by trying to benchmark map-implementations of Java and C++ in a way which is not just comparing their implementations to be honest but also lot of things around each of those, like for example memory allocation/de-allocation and compiler optimization.

What I want to highlight with this my answer is that you need a considerable analysis to be done in order to find the real reason behind your observation. It may be a simple syntactic sugar missing, or it may be complex memory-management, or maybe your benchmarks are skipping the garbage-collection part from Java? What about the process priorities that are being launched in each of those cases? Are you testing both on the same machine? Finally, as it was already pointed out by others in the comments, custom benchmarking is not so reliable.

Reasons:
  • Blacklisted phrase (1): regards
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
Posted by: Hack06