Re: [PATCH v4 2/4] Map: backport find_opt/update from 4.06

2020-09-01 Thread Christian Lindig
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

Re: [PATCH v4 2/4] Map: backport find_opt/update from 4.06

2020-08-28 Thread Edwin Torok
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

Re: [PATCH v4 2/4] Map: backport find_opt/update from 4.06

2020-08-28 Thread Christian Lindig
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

[PATCH v4 2/4] Map: backport find_opt/update from 4.06

2020-08-27 Thread Edwin Török
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