In the test I'm creating here, my goal is to create a parser. Therefore, I built a conceptual proof that reads all messages from a file, and after pressing all of them into memory, I create one process for parsing each message. So far, everything will be fine, and I have good results. But I could see that erlang VM does not use all my processor power (I have a quad-core processor), in fact it uses about 25% of my processor when performing my test. I did a counter test using C ++ that uses four threads and obviously uses 100%, which gives a better result (I respected the same queue model that erlang used).
So, I am wondering what could be "slowing down" my erlang test? I know this is not a serialization issue, as I create one process for each message. I thought that maybe my message is too small (about 10 thousand each), so most of the processes do not help to achieve excellent performance.
Some facts about the test:
106 thousand messages On erlang (25% processor power is used) - 204 ms On my C ++ test (100% processor is used) - 80 ms
Yes, the difference is not that big, but if there is more power, of course, there is more room for improvement, right?
And, I did some profiling and could not find another optimization method, since there are several function calls, and most of them are converting objects to objects.
Update:
Woooow! , 35 80 ++! !