Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* node.ocaml
@ 2010-08-22  3:27 Jeffrey Barber
  2010-08-23 21:31 ` [Caml-list] node.ocaml Jake Donham
  2010-08-23 23:29 ` Gerd Stolpmann
  0 siblings, 2 replies; 4+ messages in thread
From: Jeffrey Barber @ 2010-08-22  3:27 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 1241 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1528 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-08-23 23:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-22  3:27 node.ocaml Jeffrey Barber
2010-08-23 21:31 ` [Caml-list] node.ocaml Jake Donham
2010-08-23 22:32   ` Jeffrey Barber
2010-08-23 23:29 ` Gerd Stolpmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox