[erlang-questions] NIF vs Erlang Binary
Andy W. Song
Fri Jul 22 11:45:52 CEST 2011
I'm trying to write an Erlang WebSocket client and server against the latest
spec. It requires message masking, which simply xor the whole message using
a 4 bytes key.
I did some unit test on my code and felt that it's slow (it can process
about 24M byte/s) on a virtual machine. HiPE can double the performance but
still not quite enough. So I wrote an NIF to handle this. The speed is about
10~15x faster. Not only that, I feel that the C code is easier to write.
Maybe it's due to my inexperienced with Erlang yet.
Here is the Erlang <https://gist.github.com/1099160>and NIF
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions