[erlang-questions] OTP Efficiency

Evans, Matthew <>
Wed Jun 2 17:43:38 CEST 2010


Well OTP will add some extra load on your system.

The gen_server:call / gen_server:cast adds a bit of extra load such as monitoring of the destination process, timers, some extra pattern matching.

However, trust me, as someone who used to think that such overheads would be unacceptable and started to develop an application that wasn't OTP I soon regretted it. My application soon became a mess that was hard to debug and extend, and I soon ended up spending a day making it OTP.

The advantages that OTP provides to make your application structure easier to understand and more extendable soon pays for any performance loss you may see. I would also add that if you need reliability in your service you will just need to reinvent what OTP has already provided for you anyway.

If performance is really a high priority you can always use the handle_info callback to receive messages.

The only time I don't use OTP are for processes that never receive any (or perhaps a single) messages, and perform a unique task (such as process a batch of data, wait for a resource etc).

Matt

-----Original Message-----
From:  [mailto:] On Behalf Of maruthavanan s
Sent: Wednesday, June 02, 2010 7:06 AM
To: 
Subject: [erlang-questions] OTP Efficiency


Hi All,

 

I could understand that OTP gives us a fault tolerant solutions like restarting on crashing, supervisors, FSM behaviours etc.

 

I am curious on the efficiency of a application.

 

Say for e.g. I develop a solution with both OTP and without OTP (handling 100% errors may be not possible :) ) which one would be efficient?

 

Thanks,

Marutha
 		 	   		  


More information about the erlang-questions mailing list