Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!cs.uu.nl!news.stack.nl!.POSTED!not-for-mail From: Marco van de Voort Newsgroups: comp.lang.pascal.borland Subject: Re: Memory, objects, and TCollections Date: Fri, 27 Jul 2012 10:46:38 +0000 (UTC) Organization: Stack Usenet News Service Lines: 29 Message-ID: References: <45fb5804-296d-43f4-bd0d-ec3d109a5d27@y12g2000yqe.googlegroups.com> <26f0e9a9-0108-478f-9319-f1a88a773a51@d32g2000yqn.googlegroups.com> <91488169-ce22-42cd-b947-61ff29427407@googlegroups.com> NNTP-Posting-Host: toad.stack.nl Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: mud.stack.nl 1343385998 16892 2001:610:1108:5010::135 (27 Jul 2012 10:46:38 GMT) X-Complaints-To: abuse@stack.nl NNTP-Posting-Date: Fri, 27 Jul 2012 10:46:38 +0000 (UTC) User-Agent: slrn/0.9.9p1 (FreeBSD) Xref: csiph.com comp.lang.pascal.borland:117 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.