Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > comp.lang.pascal.borland > #117

Re: Memory, objects, and TCollections

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 <marcov@toad.stack.nl>
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 <slrnk14sce.1hrj.marcov@toad.stack.nl> (permalink)
References <45fb5804-296d-43f4-bd0d-ec3d109a5d27@y12g2000yqe.googlegroups.com> <slrnk0oqt8.1kcg.marcov@toad.stack.nl> <a73kb8FbdcU1@mid.individual.net> <26f0e9a9-0108-478f-9319-f1a88a773a51@d32g2000yqn.googlegroups.com> <slrnk0tir2.13v1.marcov@toad.stack.nl> <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

Show key headers only | View raw


On 2012-07-26, Jim Leonard <MobyGamer@gmail.com> 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.

Back to comp.lang.pascal.borland | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Memory, objects, and TCollections Jim Leonard <mobygamer@gmail.com> - 2012-07-22 11:02 -0700
  Re: Memory, objects, and TCollections Marco van de Voort <marcov@toad.stack.nl> - 2012-07-22 21:07 +0000
    Re: Memory, objects, and TCollections Robert AH Prins <spamtrap@prino.org> - 2012-07-23 02:31 +0000
      Re: Memory, objects, and TCollections Jim Leonard <mobygamer@gmail.com> - 2012-07-23 11:33 -0700
        Re: Memory, objects, and TCollections Marco van de Voort <marcov@toad.stack.nl> - 2012-07-24 16:20 +0000
          Re: Memory, objects, and TCollections Jim Leonard <MobyGamer@gmail.com> - 2012-07-26 14:19 -0700
            Re: Memory, objects, and TCollections Marco van de Voort <marcov@toad.stack.nl> - 2012-07-27 10:46 +0000
    Re: Memory, objects, and TCollections Jim Leonard <mobygamer@gmail.com> - 2012-07-23 11:42 -0700
      Re: Memory, objects, and TCollections Marco van de Voort <marcov@toad.stack.nl> - 2012-07-25 12:10 +0000
        Re: Memory, objects, and TCollections Jim Leonard <MobyGamer@gmail.com> - 2012-07-26 14:21 -0700
          Re: Memory, objects, and TCollections Marco van de Voort <marcov@toad.stack.nl> - 2012-07-27 11:13 +0000

csiph-web