Skip to content
  1. Nov 27, 2021
  2. Dec 03, 2020
  3. Oct 26, 2020
    • 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
  4. Oct 25, 2020
  5. Apr 19, 2020
  6. Feb 25, 2020
  7. Nov 24, 2018
  8. Jul 29, 2018
  9. Jun 13, 2018
  10. Jun 09, 2018
  11. Jun 06, 2018
  12. Apr 27, 2018
  13. Feb 17, 2018
    • 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
  14. Feb 11, 2018
  15. Feb 08, 2018
  16. Nov 05, 2017
  17. Oct 18, 2017
  18. Oct 13, 2017
  19. Sep 06, 2017
  20. Apr 26, 2017
  21. Apr 24, 2017
    • 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
Loading