Re: C++ hash map usage

2024-10-19 Thread Gavin Smith
On Fri, Oct 18, 2024 at 04:14:24PM +0100, Gavin Smith wrote: > On Thu, Oct 17, 2024 at 09:31:35PM +0200, Patrice Dumas wrote: > > > > Could add the number of footnotes * 2 and the number of special units > > > > (including special units not associated to a section/node). And > > > > sections numbe

Re: C++ hash map usage

2024-10-18 Thread Gavin Smith
On Thu, Oct 17, 2024 at 09:31:35PM +0200, Patrice Dumas wrote: > > > Could add the number of footnotes * 2 and the number of special units > > > (including special units not associated to a section/node). And > > > sections number should be * 3 for contents and shortcontents targets. > > > > > >

Re: C++ hash map usage

2024-10-17 Thread Patrice Dumas
On Thu, Oct 17, 2024 at 07:24:26PM +0100, Gavin Smith wrote: > On Wed, Oct 16, 2024 at 12:50:01AM +0200, Patrice Dumas wrote: > > On Tue, Oct 15, 2024 at 12:31:07PM +0100, Gavin Smith wrote: > > > On Mon, Oct 14, 2024 at 11:16:58PM +0200, Patrice Dumas wrote: > > > > This looks good to me, it is qu

Re: C++ hash map usage

2024-10-17 Thread Patrice Dumas
On Thu, Oct 17, 2024 at 07:24:26PM +0100, Gavin Smith wrote: > On Wed, Oct 16, 2024 at 12:50:01AM +0200, Patrice Dumas wrote: > > On Tue, Oct 15, 2024 at 12:31:07PM +0100, Gavin Smith wrote: > > > On Mon, Oct 14, 2024 at 11:16:58PM +0200, Patrice Dumas wrote: > > > > This looks good to me, it is qu

Re: C++ hash map usage

2024-10-17 Thread Gavin Smith
On Wed, Oct 16, 2024 at 12:50:01AM +0200, Patrice Dumas wrote: > On Tue, Oct 15, 2024 at 12:31:07PM +0100, Gavin Smith wrote: > > On Mon, Oct 14, 2024 at 11:16:58PM +0200, Patrice Dumas wrote: > > > This looks good to me, it is quite simple. Maybe the number of buckets > > > could be set based on

Re: C++ hash map usage

2024-10-15 Thread Patrice Dumas
On Tue, Oct 15, 2024 at 12:31:07PM +0100, Gavin Smith wrote: > On Mon, Oct 14, 2024 at 11:16:58PM +0200, Patrice Dumas wrote: > > This looks good to me, it is quite simple. Maybe the number of buckets > > could be set based on the number of sections + nodes + index entries? > > Great idea, I was

Re: C++ hash map usage

2024-10-15 Thread Gavin Smith
On Mon, Oct 14, 2024 at 11:16:58PM +0200, Patrice Dumas wrote: > This looks good to me, it is quite simple. Maybe the number of buckets > could be set based on the number of sections + nodes + index entries? Great idea, I was concerned that I'd hardcoded the number of buckets.

Re: C++ hash map usage

2024-10-14 Thread Patrice Dumas
On Mon, Oct 14, 2024 at 09:21:50PM +0100, Gavin Smith wrote: > I may as well post what I've been able to come up with. The new > code is about 150 lines of C, in the file convert/hashmap.c (patch > below). Probably not perfect but hopefully simple enough to be > maintainable. > > If this approac

Re: C++ hash map usage

2024-10-14 Thread Gavin Smith
On Mon, Oct 14, 2024 at 01:25:31PM +0100, Gavin Smith wrote: > These numbers do not seem so high that we need an ultra-optimised > algorithm (developed by C++ boffins) to deal with them - anything faster > than a linear search would probably good enough. > > I have some spare time over the next co

C++ hash map usage

2024-10-14 Thread Gavin Smith
On Sun, Oct 06, 2024 at 02:28:02PM +0200, Patrice Dumas wrote: > On Sun, Oct 06, 2024 at 12:09:45PM +0100, Gavin Smith wrote: > > On Sun, Oct 06, 2024 at 09:53:22AM +0200, Patrice Dumas wrote: > > > > How much slower would the linear search actually be? > > > > > > It is much slower (if I recall w