i'm fairly confident that the reason for the slowdown is that perl is converting to-and-from binary representation (vec) format, whilst C/C++ doesn't do any checking so you can just use it as integer or binary whenever. I don't know enough about the internals. Some other monk may know how to put this in code.