Using Lisp (or AutoLisp), how good is the performance of associative lists?

I am making an AutoLisp project that uses long associative structures to perform heavy geometric processing - so I wonder what synchronization results are used in the associative list. How simple / complicated is the implementation? Does it use some data structure or a regular list of point pairs? Any extension for b-tree or something else?

+3
source share
5 answers

In Common Lisp and Emacs Lisp, association lists are linked by lists, so they have linear search time. Assuming AutoLisp is the same (and if not, using the term "Associative List" is misleading), you can assume that all operations will be linear along the length of the list. For example, an alist with 100 elements, on average, should get 50 hits to find what you need.

+2
source

The turning point for SBCL on the latest x86 hardware between authentication and hash tables based on identification, provided that access is evenly distributed, is about 30-40 elements.

+4
source

, (, , ?) hashtables, API; , alist, , -, .

, , ; "". "" . "n", , , , . , (, Lisp) .

+2

AutoLisp 10 , . , .

Working in VBA or ObjectARX may have some performance benefits, but you will probably need to run some benchmarking to make sure this is really better.

+1
source

There is no extension for the b-tree that I know, but if you use Visual LISP, you can use ActiveX objects and thus access most types of databases.

0
source

Source: https://habr.com/ru/post/1699125/


All Articles