From: marcov@toad.stack.nl   
      
   On 2012-07-26, Jim Leonard wrote:   
   > This project must run on 808x systems, so no.   
      
   Dataintensive apps with those limitations, that is setting yourself up for   
   disaster, but let's take it as a given.   
      
   One of the problems then is that the hardwiring of ems/xms support, while   
   8086 compatible also adds limitations. You can't rely on it too much and   
   essentially use mainmem as a paging buffer, because what if it is missing or   
   very limited in size like on XTs and older 286s?   
      
   >> Inserting an item in larger collections becomes very slow because   
   >> it has to move (on average) n/2 items.   
   >   
   > Right, but it's only moving a 4-byte pointer so it's not that bad. I have   
   the RTL and I peeked at the implementation -- it's just an array of pointers.   
      
   That should have been on /ordered/ collections.   
      
   If you load unsorted data and insert them into a TP TSorted* or Delphi   
   TStringlist,   
   since the average item will insert in the middle of the list, there are   
   sizeof(pointer)* (N/2) bytes to move to make room for them.   
      
   So for N items that becomes a sizeof(pointer)*N^2/2 iow O(N^2) operation.   
      
   But as said typically you only start to notice it at hundreds of thousands   
   of items, and afaik standard TP datatypes are limited to 64k, so 16384 items   
   max.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|