fire-eggs / YAGP

"Yet Another GEDCOM Parser" - newer/faster/complete GEDCOM parser in C#
Apache License 2.0
9 stars 3 forks source link

Memory/performance: GEDSplitter.GetRest #52

Open fire-eggs opened 6 years ago

fire-eggs commented 6 years ago

Current logic tracks the "remainder" (as from LevelTagAndRemain) as a char[]. This requires allocating a char[] to hold the remainder, then store it in the LineData context [see LineData.Remain1].

Many consumers want the remainder as a string. So two allocations take place: the char[], and a subsequent new string() [see LineData.Remain].

Name parsing certainly takes advantage of LineData.Remain1.

GedParser.Make() is one place where the gs.Remain() call should probably be replaced with gs.RemainAsString()?