1. 26 Oct, 2020 1 commit
    • Dustin L. Howett's avatar
      unmarshal: replace manual array element copy with reflect.Copy · 117a925f
      Dustin L. Howett authored
      This commit also adds a benchmark for array unmarshaling. The difference
      is staggering.
      
      name                   old time/op    new time/op    delta
      LargeArrayUnmarshal-4    23.4µs ± 2%     0.4µs ± 2%  -98.49%  (p=0.000 n=9+9)
      
      name                   old alloc/op   new alloc/op   delta
      LargeArrayUnmarshal-4     96.0B ± 0%    128.0B ± 0%  +33.33%  (p=0.000 n=10+10)
      
      name                   old allocs/op  new allocs/op  delta
      LargeArrayUnmarshal-4      3.00 ± 0%      4.00 ± 0%  +33.33%  (p=0.000 n=10+10)
      117a925f
  2. 25 Oct, 2020 1 commit
  3. 19 Apr, 2020 8 commits
  4. 25 Feb, 2020 2 commits
  5. 24 Nov, 2018 1 commit
  6. 29 Jul, 2018 1 commit
  7. 13 Jun, 2018 1 commit
  8. 09 Jun, 2018 1 commit
  9. 06 Jun, 2018 1 commit
  10. 27 Apr, 2018 1 commit
  11. 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
  12. 11 Feb, 2018 3 commits
  13. 08 Feb, 2018 1 commit
  14. 05 Nov, 2017 2 commits
  15. 18 Oct, 2017 1 commit
  16. 13 Oct, 2017 3 commits
  17. 06 Sep, 2017 1 commit
  18. 26 Apr, 2017 1 commit
  19. 24 Apr, 2017 9 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