[erlang-questions] measuring OS context switches

ke han ke.han@REDACTED
Wed Sep 20 18:34:48 CEST 2006


On Sep 20, 2006, at 11:53 PM, Yariv Sadan wrote:

>>
>> BTW, Yariv, if you catch this email, I will be using your erlyDB
>> along with some javascript and erlang prototypes I've been working on
>> to make the front end work.
>>
>
> Ke Han, I will soon switch most ErlyDB calls to prepared statements.

I agree that prepared statements are the way to go.  I can tell from  
my experience with writing Java and Smalltalk ORMs (which always used  
prepared statements when allowed) and comparing them to what Rails  
has that Rails can pretty easily add prepared statements when they  
get around to it.

My goal in the analysis work I'm doing is to show the intrinsic  
performance differences derived from the overall architecture.  Rails  
has a large number of heterogeneous processes all relying on the OS  
for communications and context switching.  A yaws based solution  
solving the same type of webapp would only have two OS processes: the  
erlang VM and MySQL.  I want to show the overhead Rails creates by  
deferring all concurrency to the OS instead of subsuming most of it  
into a concurrency oriented language and vm.

ke han

> This should give you a big performance boost over Rails, because
> ActiveRecord doesn't use prepared statements at all AFAIK. Without
> prepared statements, MySQL has to parse each query and then plan its
> execution, which is quite expensive. Prepared statements alone should
> give you a big scalability advantage because the database is often one
> of the main bottlenecks for a webapp.
>
> Cheers,
> Yariv




More information about the erlang-questions mailing list