Firstly, I must 'fess up. I don't know Perl. I'm needing to move a large Perl application to a small embedded system and it needs to go on a serious diet.
The application has many 10's of MB of computer generated data files that contain text like this:
%my_flds =
(
"DIS" => [ 0, 33, 1, 0x0000000200000000, 0x00, 1, 0x0000000000000
+000, "" ],
"L2" => [ 1, 24, 8, 0x00000000FF000000, 0x00, 1, 0x0000000000000
+000, "" ],
"L1" => [ 2, 16, 8, 0x0000000000FF0000, 0x00, 1, 0x0000000000000
+000, "" ],
"L0" => [ 3, 15, 1, 0x0000000000008000, 0x00, 0, 0x0000000000000
+000, "" ],
"LDIS" => [ 4, 14, 1, 0x0000000000004000, 0x00, 1, 0x0000000000000
+000, "" ],
"LCNT" => [ 5, 13, 1, 0x0000000000002000, 0x00, 1, 0x0000000000000
+000, "" ],
);
%my_def =
( NAME => "CONFIG",
ADDRESS => 0x400000,
LENGTH => 64,
FLAGS => 0x001,
NOTE => "",
RESET => 0x0000000000000000,
FIELDS => \%my_flds
);
Can this be packed down into a simple binary file? If so, how would I modify the app to read this binary file?
Are there any other strategies you would recommend for reducing the footprint of an application?
Thanks,
Matt.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.