These two programs don't work the same, and there's too much that can be going on behind the scenes (particularly in C++ code). For one, your perl code uses a hash for
receivedMessage
so it only needs a lookup for
$qid
, while in C++ you
search through` receivedMessage
each time. Right there you have _O(N) difference and this is probably happening for (nearly) every line. I agree that you probably want your C++ code reviewed. Note that you'd have to supply other classes involved, as there may be many ctor's going in and out, etc. —
zdim 8 secs ago