Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[series] Series performance was Re: MySQL-protocol.r

 [1/4] from: atruter::labyrinth::net::au at: 3-Jan-2004 17:37


Hi Tim,
> But I believe that lists and blocks are implemented > differently internally, but I'm ignorant as to how. > any comments on this?
Conceptually, a block is just a collection of values where the sequence is directly known (ie. like an "array" REBOL knows where the Nth value is). A list on the other hand ensures that each value knows where the previous and next values are (finding the Nth value in this case involves "walking" the list one value at a time). The following test attempts to highlight the strength and weakness of each series! type (keep in mind that the memory cost of list! / hash! is higher than block!). Test Data One million numbers from one through to one million in a 6.75MB file. Test Environment Intel Pentium 3.0 GHz with 1GB of RAM. Operations Per Second Operation Block! List! Hash! ================== ========= ========= ========= first / last 1,961,614 2,038,423 1,936,023 pick / poke / at 1,844,334 504 1,846,456 find / select (1) 1,546,259 1,538,385 1,399,606 find / select (2) 52 51 1,402,559 foreach 13 20 19 insert 81 1,087,684 19 insert tail 1,032,956 861,769 723,152 change 1,572,834 1,569,881 1,307,086 head / tail / next 1,883,858 1,916,338 1,816,748 remove 80 1,493,110 54 remove tail 1,127,093 1,187,992 1,115,157 (1) First value in series (2) Last value in series Regards, Ashley<

 [2/4] from: andreas:bolka:gmx at: 3-Jan-2004 12:06


Saturday, January 3, 2004, 7:37:04 AM, Ashley wrote:
> Operation Block! List! Hash! > ================== ========= ========= > first / last 1,961,614 2,038,423 1,936,023
<<quoted lines omitted: 10>>
> (1) First value in series > (2) Last value in series
nice table, thanks ashley! -- Best regards, Andreas

 [3/4] from: tim:johnsons-web at: 3-Jan-2004 8:15


* Ashley Trüter <[atruter--labyrinth--net--au]> [040102 21:46]:
> Hi Tim, > > > But I believe that lists and blocks are implemented > > differently internally, but I'm ignorant as to how. > > any comments on this? >
Hi Ashley:
> Conceptually, a block is just a collection of values where the sequence is > directly known (ie. like an "array" REBOL knows where the Nth value is). A > list on the other hand ensures that each value knows where the previous > and next values are (finding the Nth value in this case involves "walking" > the list one value at a time).
That much I'm aware of. What I didn't know is if blocks are single or multiple dereferences, and if lists are single or double-linked lists. Your *very nice* test results gives some clues My guess is that the lists are double linked, and the block items are dereferenced just once. (resizable arrays?) My thought had been that perhaps using a list instead of a block for mysql-protocol in converting data types might be more efficient, however, from your test results, it's apparent that would not be the case. Whereas 'insert entails resizing the entire block and reallocating memory, big overhead. Nice work! Thanks. We should archive this somewhere. I sure will. :-) regards tim
> The following test attempts to highlight the strength and weakness of each > series! type (keep in mind that the memory cost of list! / hash! is higher
<<quoted lines omitted: 23>>
> To unsubscribe from this list, just send an email to > [rebol-request--rebol--com] with unsubscribe as the subject.
-- Tim Johnson <[tim--johnsons-web--com]> http://www.alaska-internet-solutions.com<

 [4/4] from: ptretter:charter at: 3-Jan-2004 12:00


This is an excellent table of data. I'm curious what functions you ran to obtain it. Paul Tretter

Notes
  • Quoted lines have been omitted from some messages.
    View the message alone to see the lines that have been omitted