Use High-Performance Erlang (HiPE) compiler with RabbitMQ open source message broker.

What you need to know

High-Performance Erlang (HiPE) was an ASTEC (Advanced Software TEChnology) project at the Department of Information Technology of Uppsala University during 1998–2005.

Currently HiPE compilation is not supported since the release of the release of Erlang 22 (see OTP-15596 [2019-05-14]).

OTP-15596    Application(s): erts, hipe, otp
               *** HIGHLIGHT ***
               In OTP 22, HiPE (the native code compiler) is not fully
               functional. The reasons for this are:
               There are new BEAM instructions for binary matching
               that the HiPE native code compiler does not support.
               The new optimizations in the Erlang compiler create new
               combination of instructions that HiPE currently does
               not handle correctly.
               If erlc is invoked with the +native option, and if any
               of the new binary matching instructions are used, the
               compiler will issue a warning and produce a BEAM file
               without native code.

Support for HiPE is dropped in recent releases, but there is an LLVM based just-in-time compiler for Erlang on the horizon.

RabbitMQ HiPE configuration

Use Erlang to display RabbitMQ version.

$ sudo rabbitmqctl eval "rabbit_misc:version()."
"3.6.16"

Use Erlang to display OTP release number.

$ sudo rabbitmqctl eval "rabbit_misc:otp_release()."
"19.2.1"

Use Erlang to display HiPE configuration option.

$ sudo rabbitmqctl eval "application:get_env(rabbit, hipe_enabled)."
{ok,false}

Set HiPE configuration option to true.

$ cat /etc/rabbitmq/rabbitmq.config
[
  {rabbit, [{hipe_compile, true}]}
].

Restart RabbitMQ message broker.

$ sudo systemctl restart rabbitmq-server

Use Erlang to display hipe_enabled option.

$ sudo rabbitmqctl eval "application:get_env(rabbit, hipe_enabled)."
{ok,true}

Simple benchmarks

The following results were obtained in a controlled environment, but are not representative in any way.

<th>
  Sending rate msg/s
</th>

<th>
  Receiving rate msg/s
</th>

<th>
  Sending rate msg/s
</th>

<th>
  Receiving rate msg/s
</th>

<th>
  Send
</th>

<th>
  Receive
</th>
<td>
  28528
</td>

<td>
  28528
</td>

<td>
  43518
</td>

<td>
  43518
</td>

<td>
  <strong>+52%</strong>
</td>

<td>
  <strong>+52%</strong>
</td>
<td>
  17996
</td>

<td>
  35993
</td>

<td>
  26277
</td>

<td>
  52552
</td>

<td>
  <strong>+45%</strong>
</td>

<td>
  <strong>+46%</strong>
</td>
<td>
  11771
</td>

<td>
  47048
</td>

<td>
  16340
</td>

<td>
  65361
</td>

<td>
  <strong>+38%</strong>
</td>

<td>
  <strong>+39%</strong>
</td>
<td>
  6656
</td>

<td>
  51406
</td>

<td>
  8625
</td>

<td>
  68673
</td>

<td>
  <strong>+29%</strong>
</td>

<td>
  <strong>+33%</strong>
</td>
<td>
  3782
</td>

<td>
  55109
</td>

<td>
  4746
</td>

<td>
  72729
</td>

<td>
  <strong>+25%</strong>
</td>

<td>
  <strong>+31%</strong>
</td>
<em>HiPE</em> disabled</em></th> <th colspan=2><em>HiPE</em> enabled</em></th> <th colspan=2>Percentage difference (rounded)</th>
One publisher/One consumer
One publisher/Two consumers
One publisher/Four consumers
One publisher/Eight consumers
One publisher/Sixteen consumers

These benchmarks were created using RabbitMQ PerfTest.