I need to parse an extremely large file at work and store the data in some structured data objects. The program is being written in C++ for a Unix-based system. Previous iterations of this program have exhausted the program's 4GB virtual memory space storing the info in the data objects, so memory is at a premium here.
The question is: should I use demand-based parsing where the data objects ask for further parsing from the parser object when they need it, or a full parsing scheme where the parser object fills in the data structures and hands back a pointer at the end?
The file is basically newline delimited.
The question is: should I use demand-based parsing where the data objects ask for further parsing from the parser object when they need it, or a full parsing scheme where the parser object fills in the data structures and hands back a pointer at the end?
The file is basically newline delimited.