From: Eric B. <er...@go...> - 2004-09-26 16:53:31
|
Colin Paul Adams wrote: >>>>>>"Eric" == Eric Bezault <er...@go...> writes: >>>>> > > Eric> Hello Colin, I saw that in the following routines: > > Eric> XM_XSLT_CALL_TEMPLATE find_template XM_XSLT_FUNCTION > Eric> validate XM_XSLT_STYLESHEET build_indices > Eric> XM_XSLT_STYLE_ELEMENT stylesheet_function > > Eric> you call DS_LINKED_LIST_CURSOR.back. Performance-wise it is > Eric> not a good idea to traverse linked-list backwards, > Eric> especially if they have many items. You should rather use > Eric> DS_ARRAYED_LIST or DS_BILINKED_LIST instead. > > OK. > What happened is I used to use a DS_ARRAYED_LIST and changed it to a > DS_LINKED_LIST for some (good) reason. back wasn't being used in the > routine that convinced me to change. > So I'll change it to a DS_BILINKED_LIST. Reasons to avoid DS_ARRAYED_LIST is when you have too many insertions or deletions other than at the end of the list, or too many resizing. Reasons to avoid DS_LINKED_LIST is when you have too many backward traversals or calls to `index', or that it takes too much memory space compared to arrayed lists. Reasons to avoid DS_BILINKED_LIST is that it takes too much memory space compared to linked lists. Then, choosing one or the others kinds of lists is a trade-off based on the usage we want to have with it. -- Eric Bezault mailto:er...@go... http://www.gobosoft.com |