[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    Re: Kspread row limit
From:       Tomas Mecir <mecirt () gmail ! com>
Date:       2009-12-30 13:27:34
Message-ID: 492258b10912300527i248cfe47h1e921615ad064a70 () mail ! gmail ! com
[Download RAW message or body]

2009/12/30 Boudewijn Rempt <boud@valdyas.org>:
> I wonder whether it  would be possible to use a trick similar to utf8 or utf16
> to have the best of both worlds, where you'd use more bytes to store the
> location for the higher row/col numbers, and less bytes for the lower numbers.
> I guess Microsoft must be using a trick like this in the latest version of
> Excel.
>
> Maybe it's possible to deduce something about this from the actual Excel row
> limits (1,048,576 rows, 16,384 columns, maxr * maxc = 1,717,9869,184,
> according to Hendrik).

These limits add up to a 34-bit number being necessary to store each cell index.

I can see three possible solutions:

1. Split the whole area into several regions, each being small enough
to fit into 32-bit numbers. This is what MS is probably doing, would
be my guess, with the region being split into 4 areas. The overhead
here is that for each cell access, you need to first determine which
region the row number belongs to.

2. Have two storage classes, one being 32-bit, the other 64-bit (best
done by using templates). Use the 32-bit one, and if it ever fills up
completely, move all the data into the 64-bit storage and use that one
from then on. Again, the overhead is that you need to be checking
which storage is being used currently, as well as have a reasonable
mechanism/API in place to detect when the storage fills up.

3. Simply use 64-bit numbers everywhere and call it a day, with the
reasoning that memory is cheap and the memory overhead is about 10% of
the actual data, usually less (depending on what you have in the
cells).

/ Tomas
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic