[erlang-questions] What does "soft" real-time mean?

Santiago Fernandez santif@REDACTED
Fri Oct 20 15:48:13 CEST 2017


In general Erlang is not the best option to do CPU intensive computations,
especially with a single process.

I use Elixir/Erlang in financial apps to route incoming messages to
websocket clients, process concurrent orders, etc. But, in my own
benchmarks, it takes 5-10 microseconds only to parse a FIX incoming message
(same process, no inter process comunication).

https://github.com/santif/ex_fix#benchmarks

I think if you need Erlang for concurrency/scalability *and* you need to do
some kind of HFT, so the way to go is by using a NIF or linked in driver
(C, Rust?)

If you only need to do HFT, I think there is no reason to stick with
Erlang, since there is no competition with the slowest C app.

HTH


--
Santiago

On Fri, Oct 20, 2017 at 10:46 AM, Sergej Jurečko <sergej.jurecko@REDACTED>
wrote:

> Erlang is the right tool for the job for a majority of server workloads.
> However when your requirements are a reaction time in microseconds, it most
> surely is not the right tool.
>
> I would use Rust in that scenario if you’re picking languages.
>
>
> Regards,
> Sergej
>
> > On 20 Oct 2017, at 14:00, Avinash Dhumane <nistrigunya@REDACTED> wrote:
> >
> > I have programmed high-frequency trading application in Erlang and
> comparing its reaction performance in the live market with other competing
> applications (mostly, in C).
> >
> > It has been a consistent observation that my Erlang application lags
> substantially behind the competing applications. In fact, it never matched
> the reaction time of the so-called "slowest" C application in the market.
> >
> > The benchmark reaction time is about 5 microseconds. It is the time
> elapsed between tick to order. That is, the difference between the
> timestamps when I receive the tick (market event) from the mailbox of my
> process and when I submit the TCP send call on my order.
> >
> > My process maintains the market depths of the securities and when my
> desired price (as a function of best buyers and/or sellers on multiple legs
> of the order) is observed, I compute the order terms and submit.
> >
> > The entire computation and communication (with the market) takes place
> within the single process and there are no collaborating processes (hence,
> no inter-process messaging; not even ETS). Still, the reaction time is in
> the order of 20 to 60 microseconds - that is, nowhere closer to the
> benchmark reaction time (5 microseconds).
> >
> > What I wish to hear from the experienced people on this forum here is
> whether I am missing on something in my Erlang code, or should I just go
> ahead and program in C.
> >
> > Thanks.
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions@REDACTED
> > http://erlang.org/mailman/listinfo/erlang-questions
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20171020/d8b1ebe5/attachment.htm>


More information about the erlang-questions mailing list