1. 19 Apr, 2020 8 commits
  2. 25 Feb, 2020 2 commits
  3. 24 Nov, 2018 1 commit
  4. 29 Jul, 2018 1 commit
  5. 13 Jun, 2018 1 commit
  6. 09 Jun, 2018 1 commit
  7. 06 Jun, 2018 1 commit
  8. 27 Apr, 2018 1 commit
  9. 17 Feb, 2018 1 commit
    • Dustin L. Howett's avatar
      xml: rewrite the xml generator to avoid xml.Encoder · 84d08b7b
      Dustin L. Howett authored
      This commit intoduces a mostly hand-rolled XML encoder inspired by
      xml.Encoder. Since plist is a simple format that doesn't require
      attributes, only has one data type with encodeable input and is
      otherwise constrained, we don't need the full power of encoding/xml.
      
      The encoder's speed, memory requirements and number of allocations are
      all improved.
      
      In addition, we can now emit self-closing tags for empty elements
      (<key></key> -> <key/>).
      
      Fixes https://github.com/DHowett/go-plist/issues/34.
      
      name                    old time/op    new time/op    delta
      XMLEncode-4               25.9µs ± 3%    14.9µs ± 1%   -42.66%
      BigXMLGenerate-4          47.3ms ± 1%    23.7ms ± 1%   -49.91%
      BigPrettyXMLGenerate-4    55.0ms ± 1%    30.0ms ± 1%   -45.42%
      XMLGenerate-4             16.0µs ± 1%     5.8µs ± 1%   -63.81%
      
      name                    old alloc/op   new alloc/op   delta
      XMLEncode-4               8.71kB ± 0%    6.42kB ± 0%   -26.26%
      BigXMLGenerate-4          2.62MB ± 0%    1.60MB ± 0%   -39.02%
      BigPrettyXMLGenerate-4    2.62MB ± 0%    1.60MB ± 0%   -39.02%
      XMLGenerate-4             5.83kB ± 0%    4.50kB ± 0%   -22.77%
      
      name                    old allocs/op  new allocs/op  delta
      XMLEncode-4                 88.0 ± 0%      63.0 ± 0%   -28.41%
      BigXMLGenerate-4           86.7k ± 0%     72.6k ± 0%   -16.24%
      BigPrettyXMLGenerate-4     86.7k ± 0%     72.6k ± 0%   -16.24%
      XMLGenerate-4               54.0 ± 0%      31.0 ± 0%   -42.59%
      84d08b7b
  10. 11 Feb, 2018 3 commits
  11. 08 Feb, 2018 1 commit
  12. 05 Nov, 2017 2 commits
  13. 18 Oct, 2017 1 commit
  14. 13 Oct, 2017 3 commits
  15. 06 Sep, 2017 1 commit
  16. 26 Apr, 2017 1 commit
  17. 24 Apr, 2017 11 commits
    • Dustin L. Howett's avatar
    • Dustin L. Howett's avatar
      [test] Rearrange all the tests/use subtests · f0ef9988
      Dustin L. Howett authored
      This commit moves all of the text tests into the common tests, the
      invalid tests out of the common tests (since the test fixtures had to
      have a lot of logic to handle "expected fail" tests, and it wasn't a
      good idea anyway), and moves all formats into their own subtests.
      
      TestData's members have been renamed to make them less naive.
      f0ef9988
    • Dustin L. Howett's avatar
      [text] Rewrite the text plist parser to be like text/template/parser · c17dcc5f
      Dustin L. Howett authored
      This commit overhauls the text property list parser, reducing the cost
      in time and memory and overall sanity required to parse text property
      list documents.
      
      Herein, support is also added for:
      * UTF-16 text property lists (#26)
      * Proper scanning of UTF-8 codepoints
      * Encoding conversion (UTF-16{BE,LE) +- BOM -> UTF-8)
      * Empty data values, <>
      * Error messages that include line and column info (#25)
      * Legacy strings file format (dictionary without { }) (#27)
      * Shortcut strings file format (dictionaries without values) (#27)
      * Short hex/unicode/octal escapes (\x2, \u33, \0)
      * Empty documents parsing as empty dictionaries
      * Detection of garbage after the end of a document
      
      The character tables have been augmented with their own characterSet
      type, which allows them to report on their own residence. All characters
      outside the 0-255 range will be considered "not in set" for now.
      
      In the benchmarks below, *Step(Parse|Decode) operate on a relatively
      small synthetic property list that contains every property list type.
      BigParse operates on a ~700kb binary property list created by converting
      the iTunes software update catalog from XML to GNUStep or OpenStep.
      Pretty benchmarks include whitespace.
      
      benchmark                             old ns/op     new ns/op     delta
      BenchmarkBigGNUStepParse-4            125008990     33544860      -73.17%
      BenchmarkBigPrettyGNUStepParse-4      54869160      38049063      -30.65%
      BenchmarkBigOpenStepParse-4           124436480     31491614      -74.69%
      BenchmarkBigPrettyOpenStepParse-4     54080760      34542446      -36.13%
      BenchmarkOpenStepParse-4              20177         13894         -31.14%
      BenchmarkGNUStepParse-4               18742         15087         -19.50%
      
      benchmark                             old allocs     new allocs     delta
      BenchmarkBigGNUStepParse-4            2248154        120655         -94.63%
      BenchmarkBigPrettyGNUStepParse-4      969515         120655         -87.56%
      BenchmarkBigOpenStepParse-4           2251448        120655         -94.64%
      BenchmarkBigPrettyOpenStepParse-4     969541         120655         -87.56%
      BenchmarkOpenStepParse-4              234            44             -81.20%
      BenchmarkGNUStepParse-4               186            47             -74.73%
      
      benchmark                             old bytes     new bytes     delta
      BenchmarkBigGNUStepParse-4            67633657      24006777      -64.50%
      BenchmarkBigPrettyGNUStepParse-4      30100843      24006784      -20.25%
      BenchmarkBigOpenStepParse-4           67657126      24023625      -64.49%
      BenchmarkBigPrettyOpenStepParse-4     30101001      24023619      -20.19%
      BenchmarkOpenStepParse-4              15376         10192         -33.71%
      BenchmarkGNUStepParse-4               14992         10320         -31.16%
      
      Fixes #25
      Fixes #26
      Fixes #27
      c17dcc5f
    • Dustin L. Howett's avatar
      [text] Expand the text test collateral · c4a68d89
      Dustin L. Howett authored
      Empty data plists, <>, are no longer invalid.
      c4a68d89
    • Dustin L. Howett's avatar
      4133aaab
    • Dustin L. Howett's avatar
      779f22da
    • Dustin L. Howett's avatar
      fc3f05fd
    • Dustin L. Howett's avatar
      [travis] Test the appengine tag as well · 3df3cb8e
      Dustin L. Howett authored
      3df3cb8e
    • Dustin L. Howett's avatar
      [bplist] Share the plist's backing buffer for ASCII strings · 57d3140a
      Dustin L. Howett authored
      This commit includes a fallback for appengine builds that keeps the
      original copying behavior.
      
      benchmark                     old ns/op     new ns/op     delta
      BenchmarkBigBplistParse-4     9803683       9587863       -2.20%
      BenchmarkBplistParse-4        9171          8743          -4.67%
      BenchmarkBplistDecode-4       10613         10063         -5.18%
      
      benchmark                     old allocs     new allocs     delta
      BenchmarkBigBplistParse-4     64311          58238          -9.44%
      BenchmarkBplistParse-4        50             43             -14.00%
      BenchmarkBplistDecode-4       54             47             -12.96%
      
      benchmark                     old bytes     new bytes     delta
      BenchmarkBigBplistParse-4     5951707       5544876       -6.84%
      BenchmarkBplistParse-4        3808          3760          -1.26%
      BenchmarkBplistDecode-4       4032          3984          -1.19%
      57d3140a
    • Dustin L. Howett's avatar
      [bplist] Rewrite the parser to operate on memory instead of a ReadSeeker · fdb43dd6
      Dustin L. Howett authored
      This rewrite reduces the time and memory required to parse binary
      property lists. Validation was performed via coverage-directed fuzzing.
      
      In the benchmarks below, Bplist(Parse|Decode) operate on a relatively
      small synthetic property list that contains every property list type.
      BigBplistParse operates on a ~700kb binary property list created by
      converting the iTunes software update catalog from XML to binary.
      
      benchmark                     old ns/op     new ns/op     delta
      BenchmarkBplistParse-4        26971         8597          -68.13%
      BenchmarkBplistDecode-4       27148         10356         -61.85%
      BenchmarkBigBplistParse-4     33316470      10815886      -67.54%
      
      benchmark                     old allocs     new allocs     delta
      BenchmarkBplistParse-4        324            50             -84.57%
      BenchmarkBplistDecode-4       327            54             -83.49%
      BenchmarkBigBplistParse-4     438561         64311          -85.34%
      
      benchmark                     old bytes     new bytes     delta
      BenchmarkBplistParse-4        4688          3808          -18.77%
      BenchmarkBplistDecode-4       4768          4032          -15.44%
      BenchmarkBigBplistParse-4     7980868       5951717       -25.43%
      
      The time and allocation gains are visible across the board, and
      consistent between large and small property lists. The number of bytes
      allocated and copied is drastically better in the large property list
      case.
      fdb43dd6
    • Bobrnor's avatar