[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Subrata - the type of data you will be bulking is going to be numbers, not
silly text strings.

Here are some example sizes of encodings...

0-127 - BER 3 octets, ASCII 1-3 octets
128-32767 - BER 4 octets, ASCII 3-5 octets
32767-8388607 - BER 5 octets, ASCII 5-7 octets
8388608-2147483647 - BER 6 octets, ASCII 7-10 octets

Plus with ascii, you need a delimiter characters (such as a space or comma)
between values, so the above counts for ascii are higher.

A printf looks pretty simple in C, but lots are work is done
(that eats CPU) to get the ascii chars. It is much less CPU work
to generate the BER.

As Juergen says, try it yourself. Both of us have.

At 02:25 AM 12/6/2001 +0100, Juergen Schoenwaelder wrote:

>>>>>> Subrata Goswami writes:
>Subrata> well, let us look at the following string (say for sysDescr):
>Subrata> "my system".
>Subrata> 1) ASCII: 9 bytes 2) BER: 4+4+18 = 34 bytes.
>Subrata> So I would say ASCII is 400 % more efficient. am i right ?
>BER requires only 11 bytes in this case. You first need to understand
>who something works before you can argue about it. Also note that your
>math is incorrect: 4+4+18 gives 26 and not 34.
>Also note that BER encoding communicates the type and the length of
>the string variable. Now show me the ASCII encoding that does the same
>with less than 11 bytes...
/david t. perkins