agnicore / nfx

.NET Standard Unistack Framework
http://nfxlib.com
Other
75 stars 91 forks source link

BISAC codes increase assembly size by 300kb due to string repetition #32

Closed agnibos closed 6 years ago

agnibos commented 6 years ago

Need to use prefix tree, as the whole structure consists of many repetitions, OR we can store the data as JSON/laconic compressed include file, decompress it on run from resource segment. We can also use SealedStrings not to keep all of the crap in memory

 private static readonly IDictionary<string, string> s_ANT
      = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
      {
        { "ANT000000", "ANTIQUES & COLLECTIBLES / General" },
        { "ANT001000", "ANTIQUES & COLLECTIBLES / Americana" },
        { "ANT002000", "ANTIQUES & COLLECTIBLES / Art" },
        { "ANT003000", "ANTIQUES & COLLECTIBLES / Autographs" },
        { "ANT005000", "ANTIQUES & COLLECTIBLES / Books" },
        { "ANT006000", "ANTIQUES & COLLECTIBLES / Bottles" },
        { "ANT007000", "ANTIQUES & COLLECTIBLES / Buttons & Pins" },
        { "ANT008000", "ANTIQUES & COLLECTIBLES / Care & Restoration" },
        { "ANT009000", "ANTIQUES & COLLECTIBLES / Transportation" },
        { "ANT010000", "ANTIQUES & COLLECTIBLES / Clocks & Watches" },
        { "ANT011000", "ANTIQUES & COLLECTIBLES / Coins, Currency & Medals" },
        { "ANT012000", "ANTIQUES & COLLECTIBLES / Comics" },
        { "ANT015000", "ANTIQUES & COLLECTIBLES / Dolls" },
        { "ANT016000", "ANTIQUES & COLLECTIBLES / Firearms & Weapons" },
...
itadapter commented 6 years ago

Definitely gotta be a trie with much compression benefit. Not sure @agnibos that SealedStrings make any sense at all since there will not be that much data at all

sergey-msu commented 6 years ago

NFX is not appropriate place to BISAC standard. Moved to MYI solution DONE