[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Most used words in current buffer
From: |
Bob Proulx |
Subject: |
Re: Most used words in current buffer |
Date: |
Mon, 23 Jul 2018 00:09:15 -0600 |
User-agent: |
Mutt/1.10.1 (2018-07-13) |
tomas@tuxteam.de wrote:
> Stefan Monnier wrote:
> > I'd use a hash-table (implemented in C) rather than an avl-tree
> > (implemented in Elisp).
With exactly those choices above I would agree completely.
> Plus, a (well-implemented) hash table will always be faster (for inserts
> and random lookups) than a balanced (AVL, red-black) binary tree. The
> latter affords you sorted lookup (find first greater than, output in order).
>
> You pay for that :-)
Again the hash table is good until you need to grow the table. Then
there is a pause while memory is shuffled around. But that never
happens with a balanced tree because that cost is always amortized
along as you go.
Also if you need to extract the entries in sorted order then the
balanced tree is already sorted. Whereas with the hash table an extra
sort step is needed.
One of looking at this is that it is global optimization versus local
optimization.
In some ways it is swings and roundabouts. But in other ways it
depends upon what you need.
Bob
- Re: Most used words in current buffer, (continued)
- Message not available
- Re: Most used words in current buffer, Udyant Wig, 2018/07/22
- Re: Most used words in current buffer, Eric Abrahamsen, 2018/07/22
- Message not available
- Re: Most used words in current buffer, Udyant Wig, 2018/07/22
- Message not available
- Re: Most used words in current buffer, Udyant Wig, 2018/07/20
- Re: Most used words in current buffer, Stefan Monnier, 2018/07/21
- Re: Most used words in current buffer, tomas, 2018/07/22
- Re: Most used words in current buffer,
Bob Proulx <=
- Re: Most used words in current buffer, tomas, 2018/07/23
- Message not available
- Re: Most used words in current buffer, Udyant Wig, 2018/07/23
- Message not available
- Re: Most used words in current buffer, Udyant Wig, 2018/07/22
- Message not available
- Re: Most used words in current buffer, Udyant Wig, 2018/07/21
- Re: Most used words in current buffer, Stefan Monnier, 2018/07/21
- Message not available
- Re: Most used words in current buffer, Udyant Wig, 2018/07/22