From: Jeffrey Barber <jeff@mathgladiator.com>
To: caml-list@inria.fr
Subject: node.ocaml
Date: Sat, 21 Aug 2010 22:27:41 -0500 [thread overview]
Message-ID: <AANLkTinRDkL+Bk+6CB+zSONqq5+LFk31sFRUuSmH9t22@mail.gmail.com> (raw)
[-- 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 --]
next reply other threads:[~2010-08-22 3:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-22 3:27 Jeffrey Barber [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTinRDkL+Bk+6CB+zSONqq5+LFk31sFRUuSmH9t22@mail.gmail.com \
--to=jeff@mathgladiator.com \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox