From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id E89797FAF6 for ; Mon, 1 Dec 2014 11:52:30 +0100 (CET) Received-SPF: Neutral (mail2-smtp-roc.national.inria.fr: domain of simon.cruanes.2007@m4x.org does not assert whether or not 129.104.30.34 is permitted sender) identity=pra; client-ip=129.104.30.34; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="SRS0=xpn7=AV=m4x.org=simon.cruanes.2007@bounces.m4x.org"; x-sender="simon.cruanes.2007@m4x.org"; x-conformance=sidf_compatible; x-record-type="spf2.0" Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of SRS0=xpn7=AV=m4x.org=simon.cruanes.2007@bounces.m4x.org designates 129.104.30.34 as permitted sender) identity=mailfrom; client-ip=129.104.30.34; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="SRS0=xpn7=AV=m4x.org=simon.cruanes.2007@bounces.m4x.org"; x-sender="SRS0=xpn7=AV=m4x.org=simon.cruanes.2007@bounces.m4x.org"; x-conformance=sidf_compatible; x-record-type="spf2.0" Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of postmaster@mx1.polytechnique.org designates 129.104.30.34 as permitted sender) identity=helo; client-ip=129.104.30.34; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="SRS0=xpn7=AV=m4x.org=simon.cruanes.2007@bounces.m4x.org"; x-sender="postmaster@mx1.polytechnique.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvQCAG1HfFSBaB4inGdsb2JhbABbg1dYgwXDXoEkhGiBVRYBAQEBAREBAQEBAQgLCQkULoQDAQEEI1YQCyEhAgIPBUmIUwQJvFqWIJN3NIEfBZVShnSBa5dVbgWCQgEBAQ X-IPAS-Result: AvQCAG1HfFSBaB4inGdsb2JhbABbg1dYgwXDXoEkhGiBVRYBAQEBAREBAQEBAQgLCQkULoQDAQEEI1YQCyEhAgIPBUmIUwQJvFqWIJN3NIEfBZVShnSBa5dVbgWCQgEBAQ X-IronPort-AV: E=Sophos;i="5.07,493,1413237600"; d="asc'?scan'208";a="110436991" Received: from mx1.polytechnique.org ([129.104.30.34]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 01 Dec 2014 11:52:30 +0100 Received: from fuck_yeah (mna75-4-82-225-76-110.fbx.proxad.net [82.225.76.110]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ssl.polytechnique.org (Postfix) with ESMTPSA id 5AC26140C50C8; Mon, 1 Dec 2014 11:52:29 +0100 (CET) Date: Mon, 1 Dec 2014 11:52:27 +0100 From: Simon Cruanes To: Thomas Gazagnaire Cc: OCaml users Message-ID: <20141201105227.GB8862@fuck_yeah> References: <20141201094430.GA8862@fuck_yeah> <591F1716-EE97-4A11-8CFA-A073ED5E64C3@gazagnaire.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hHWLQfXTYDoKhP50" Content-Disposition: inline In-Reply-To: <591F1716-EE97-4A11-8CFA-A073ED5E64C3@gazagnaire.org> User-Agent: Mutt/1.5.22 (2013-10-16) X-AV-Checked: ClamAV using ClamSMTP at svoboda.polytechnique.org (Mon Dec 1 11:52:29 2014 +0100 (CET)) X-Spam-Flag: No, tests=bogofilter, spamicity=0.000141, queueID=ACEB2140C50D2 X-Org-Mail: simon.cruanes.2007@polytechnique.org Subject: Re: [Caml-list] [ANN] cconv-0.2 --hHWLQfXTYDoKhP50 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Le Mon, 01 Dec 2014, Thomas Gazagnaire a =C3=A9crit : > Do you have any benchmarks to compare CConv and similar camlp4 generators? Hi Thomas, I hadn't, but I just wrote very basic ones to compare with ppx_deriving_yojson (should be similar to camlp4). The code is at https://github.com/c-cube/cconv/blob/e80ab0e6c458a01b419ea69c7f41d0a350aebb= ad/bench/run_bench.ml It only compares times for encoding into Json right now, with the following results (recursive records first, recursive terms then; "manual" is a handwritten encoding function, "cconv" the combinators version, and "deriving_yojson" uses @whitequark's nice deriver): % ./run_bench.native benchmark points Throughputs for "manual", "cconv", "deriving_yojson" each running for at le= ast 4 CPU seconds: manual: 4.20 WALL ( 4.20 usr + 0.00 sys =3D 4.20 CPU) @ 3057270= .82/s (n=3D12846652) cconv: 4.21 WALL ( 4.21 usr + 0.00 sys =3D 4.21 CPU) @ 784724.= 92/s (n=3D3300553) deriving_yojson: 4.21 WALL ( 4.21 usr + 0.00 sys =3D 4.21 CPU) @ 3065779= .07/s (n=3D12891601) Rate cconv manual deriving_yojson cconv 784725/s -- -74% -74% manual 3057271/s 290% -- -0% deriving_yojson 3065779/s 291% 0% -- benchmark terms Throughputs for "manual", "cconv", "deriving_yojson" each running for at le= ast 4 CPU seconds: manual: 4.20 WALL ( 4.20 usr + 0.00 sys =3D 4.20 CPU) @ 1679609= .71/s (n=3D7057720) cconv: 4.20 WALL ( 4.20 usr + 0.00 sys =3D 4.20 CPU) @ 726619.= 43/s (n=3D3051075) deriving_yojson: 4.20 WALL ( 4.20 usr + 0.00 sys =3D 4.20 CPU) @ 1624740= .65/s (n=3D6822286) Rate cconv deriving_yojson manual cconv 726619/s -- -55% -57% deriving_yojson 1624741/s 124% -- -3% manual 1679610/s 131% 3% -- So yeah, unsurprisingly, there is some overhead :(. There is some dispatching through records-of-functions going on, because combinators should work with any backend, whereas specialized encoders can build the result directly. --=20 Simon http://weusepgp.info/ key 49AA62B6, fingerprint 949F EB87 8F06 59C6 D7D3 7D8D 4AC0 1D08 49AA 62B6 --hHWLQfXTYDoKhP50 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUfEhrAAoJEErAHQhJqmK25nsP+waXxk3BzVb185Kkqo70ocK9 5P/ZDVpyL694qmnkr5zL8utANY8+XyTevAXmbEedfcSpJHpoatE7C75958bJ/ZlT ysvLRpN77HMOMK0PKvN9KqEIGQBDnKNEZxz/nO6P63/q8/TOYmnfwtswBEpSPQVe DmsNoYXdJ8HE6hNzn1Ud1xDyr/PY1orpTgQ1IhtPakknBqerHbsH7HQufz0w7xeo HaPXZ0zwRTVQhJVwhHZ4DKqrm8Icp2ogM8Pta+AbppjPfFPd5Bpulh9lgoo0UyQy dyZi0NwxWshxUgPIvCv1q8bK5NXsBNrIOS1pi8ugotvNZyagyapsBK6D+gUlhHL6 CK1s1HbVJ9jYFCk20KZ1BD5JULUOmna3YZTWKyqXIJUP9+hnGoozxNmbXKOOV0na dXrPapyD/p2DxMFkC36jYKHvSQBcrnAs0MgW2iVmM9PUa7bN2iBNknesIv5vI+EE O52TXl8EAVAbrSR5TzFnDeFTAZ3PV52m4Ku20Ny+SW23oOPs7ofyQAxhZwW2Iy1X ciI+S5HAa5qEUKn8v7ThGHVIY3DxC4iplQqJJ6KM6+QA8CZmcpg9B7tnKBNFbWYm ZbsQtFn2Cd/EKYOEaFq/u/YAtE5lGdCyR3Km6bLR2W0dga5TalQ6LGp8JW/oPecL UO4E/nU79GhYRhVpMSz9 =QbQC -----END PGP SIGNATURE----- --hHWLQfXTYDoKhP50--