1. Sequence compression question.
- Posted by "Hayden McKay" <hmck1 at dodo.com.au> Dec 16, 2003
- 496 views
--=======AVGMAIL-3FDEC7C46124======= ------=_NextPart_000_001C_01C3C40E.1DD52500 How much memory does a sequence use. for example how much memory is allocated for an empty sequence. And how much memory is used for a sequence of say 4 subscripts and is there extra empty memory being allocated. The reason I ask, is that I have a method similer to formula converting binary into decimal, to compress single words in a string to single integers in a sequence, then convert back to a string of words. Would this actualy save much memory for stored strings? --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.551 / Virus Database: 343 - Release Date: 11/12/03 ------=_NextPart_000_001C_01C3C40E.1DD52500 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"> <META content="MSHTML 6.00.2800.1276" name=GENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=#ffffff> <DIV><FONT face=Arial size=2>How much memory does a sequence use.</FONT></DIV> <DIV><FONT face=Arial size=2>for example how much memory is allocated for an empty sequence. And how much memory is used for a sequence of say 4 subscripts and is there extra empty memory being allocated.</FONT></DIV> <DIV> </DIV> <DIV><FONT face=Arial size=2>The reason I ask, is that I have a method similer to formula converting binary into decimal, to compress single words in a string to single integers in a sequence, then convert back to a string of words. Would this actualy save much memory for stored strings?</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV> </DIV> <DIV><FONT face=Arial size=2><BR>---<BR>Outgoing mail is certified Virus Free.<BR>Checked by AVG anti-virus system (<A href="http://www.grisoft.com">http://www.grisoft.com</A>).<BR>Version: 6.0.551 / ------=_NextPart_000_001C_01C3C40E.1DD52500-- --=======AVGMAIL-3FDEC7C46124======= Content-Type: text/plain; x-avg=cert; charset=iso-8859-2 Content-Transfer-Encoding: 8bit Content-Disposition: inline Content-Description: "AVG certification" Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.551 / Virus Database: 343 - Release Date: 11/12/03 --=======AVGMAIL-3FDEC7C46124=======--
2. Re: Sequence compression question.
- Posted by Robert Craig <rds at RapidEuphoria.com> Dec 16, 2003
- 490 views
Hayden McKay wrote: > How much memory does a sequence use. > for example how much memory is allocated for an empty sequence. And how > much memory is used for a sequence of say 4 subscripts and is > there extra empty memory being allocated. > > The reason I ask, is that I have a method similer to formula converting > binary into decimal, to compress single words in a string to single > integers in a sequence, then convert back to a string of words. Would > this actualy save much memory for stored strings? If you look at euphoria\include\euphoria.h, you'll see a C structure called struct s1. (There used to be a struct s2, but it was eliminated years ago.) struct s1 has 4 fields of size 4 bytes each. This 16-byte structure appears as the header of all sequences. The elements of a sequence are always 4 bytes, even if they represent very small integers. Floating-point numbers and sequences are represented by 4-byte pointers to other blocks of data. Of course, anything that is allocated from the heap will have other storage overheads, e.g. the size of the allocated block, or some filler space to get the desired alignment in memory, etc. Regards, Rob Craig Rapid Deployment Software http://www.RapidEuphoria.com