he it saves the
lookup for mem(). And moving to OCaml 4.06 improves performance.
-- C
From: Edwin Torok
Sent: 28 August 2020 18:43
To: Christian Lindig; xen-devel@lists.xenproject.org
Cc: Ian Jackson; d...@recoil.org; w...@xen.org
Subject: Re: [PATCH v4 2/4
On Fri, 2020-08-28 at 10:30 +0200, Christian Lindig wrote:
> +let find_opt k t =
>
> + (* avoid raising exceptions, they can be expensive *)
>
> + if mem k t then Some (find k t) else None
>
>
>
> I disagree with this argument. Exceptions in OCaml are cheap because
> they don't wal
From: Edwin Török
Sent: 27 August 2020 18:35
To: xen-devel@lists.xenproject.org
Cc: Edwin Torok; Christian Lindig; David Scott; Ian Jackson; Wei Liu
Subject: [PATCH v4 2/4] Map: backport find_opt/update from 4.06
We are currently on OCaml 4.02 as minimum
We are currently on OCaml 4.02 as minimum version.
To make the followup optimizations compile backport these functions from
OCaml 4.06.
This implementation is less efficient than the one in the 4.06 standard
library which has access to the internals of the Map.
Signed-off-by: Edwin Török
---
Cha