From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 19551BC57 for ; Sun, 22 Aug 2010 05:27:44 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aq8BAFo2cEzRVdg2kGdsb2JhbACTH4UKiAMIFQEBAQEJCQwHEQMfoFiZN4U3BIQ1hUE X-IronPort-AV: E=Sophos;i="4.56,249,1280700000"; d="scan'208";a="65957086" Received: from mail-qw0-f54.google.com ([209.85.216.54]) by mail1-smtp-roc.national.inria.fr with ESMTP; 22 Aug 2010 05:27:43 +0200 Received: by qwg5 with SMTP id 5so5294141qwg.27 for ; Sat, 21 Aug 2010 20:27:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.211.81 with SMTP id gn17mr918732qcb.19.1282447661534; Sat, 21 Aug 2010 20:27:41 -0700 (PDT) Received: by 10.229.17.205 with HTTP; Sat, 21 Aug 2010 20:27:41 -0700 (PDT) X-Originating-IP: [99.180.100.231] Date: Sat, 21 Aug 2010 22:27:41 -0500 Message-ID: Subject: node.ocaml From: Jeffrey Barber To: caml-list@inria.fr Content-Type: multipart/alternative; boundary=0016362843c44f0cc7048e611d50 X-Spam: no; 0.00; node:01 ocaml:01 ocaml:01 node:01 ocaml's:01 hashtbl:01 hacked:01 ocaml's:01 hashtbl:01 hacked:01 begged:98 ubuntu:98 2100:98 5300:98 begged:98 --0016362843c44f0cc7048e611d50 Content-Type: text/plain; charset=ISO-8859-1 I've been working with libevent2 and OCaml for the past couple of weeks to build node.ocaml. It is far from done, but it is interesting enough to share. node.ocaml as of now contains a web server and a terminal server that provides asynchronous programming to OCaml to enable some of my research. The first example server is a key value pair server that brings OCaml's Hashtbl to http and terminal IO: example code: http://github.com/mathgladiator/node.ocaml/blob/master/test/kvp.ml This is the first test program, and it works fairly well in a single threaded environment. I was inspired by node.js to build an evented io system, and so I begged the question "how does 'OCaml's FFI' compare with v8's in node.js". In my virtual machine environment (ubuntu 10.04), I got the following results doing 10,000 requests 50 at a time: node.js with the "Hello World" script: 2100 requests/second node.ocaml with kvp.ml: 5300 requests/second This seems to me to be a very positive first benchmark considering I haven't optimized anything yet nor have I hacked caml_copy_string yet. The code is licensed under BSD and available http://github.com/mathgladiator/node.ocaml . Any thoughts/questions are appreciated; thank you for your time. -J --0016362843c44f0cc7048e611d50 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I've been working with libevent2 and OCaml for the past couple of weeks= to build node.ocaml. It is far from done, but it is interesting enough to = share.

node.ocaml as of now contains a web server and a terminal ser= ver that provides asynchronous programming to OCaml to enable some of my re= search. The first example server is a key value pair server that brings OCa= ml's Hashtbl to http and terminal IO:

example code: http://github.com/mathgladiator/node.ocaml/blob/maste= r/test/kvp.ml

This is the first test program, and it works fairl= y well in a single threaded environment. I was inspired by node.js to build= an evented io system, and so I begged the question "how does 'OCa= ml's FFI' compare with v8's in node.js". In my virtual mac= hine environment (ubuntu 10.04), I got the following results doing 10,000 r= equests 50 at a time:

node.js with the "Hello World" script:
2100 requests/secon= d

node.ocaml with kvp.ml:
5300 requ= ests/second

This seems to me to be a very positive first benchmark c= onsidering I haven't optimized anything yet nor have I hacked caml_copy= _string yet.

The code is licensed under BSD and available http://github.com/mathgladiator/node.ocaml= .

Any thoughts/questions are appreciated; thank you for your time.<= br>
-J
--0016362843c44f0cc7048e611d50--