frizbog / gedcom4j

Java library for reading/writing genealogy files in GEDCOM format
http://gedcom4j.org
54 stars 36 forks source link

Parse StringTree nodes on-the-fly #109

Closed frizbog closed 8 years ago

frizbog commented 8 years ago

The GedcomParser still loads the entire file into memory before parsing it into the object model - it used to do it twice: once into an ArrayList, which was loaded into a StringTree hierarchy, which was then parsed into the object model. The ArrayList was removed recently, but the entire file is still loaded into the StringTree object...which is really unnecessary. Each 0-level item can be parsed as a root-level node as soon as the next 0-level item is encountered, and once it's parsed, it can be discarded (and garbage collected!), which should save memory and be faster.

frizbog commented 8 years ago

This has made a significant improvement in peak memory usage, although no difference in memory usage once the file has been loaded into memory.

frizbog commented 8 years ago

Released in v3.0.0