1. 25 4月, 2018 5 次提交
  2. 24 4月, 2018 1 次提交
  3. 23 4月, 2018 6 次提交
  4. 21 4月, 2018 14 次提交
  5. 20 4月, 2018 2 次提交
    • A
      DataSize: replace __getattr__ and __dir__ by actual properties · 970d850a
      Amador Pahim 提交于
      We loose in flexibility by the performance improvement justifies the
      change. Since __getattr__ is the last resource python tries to solve
      attributes, creating the actual properties makes the resolution to
      happen earlier and the performance to be way better.
      
      Before this patch:
      
      >>> timeit.timeit('data_structures.DataSize("1M").b',
                        setup='from avocado.utils import data_structures',
                        number=1000000)
      >>> 2.0695440769195557
      
      After this patch:
      
      >>> timeit.timeit('data_structures.DataSize("1M").b',
                        setup='from avocado.utils import data_structures',
                        number=1000000)
      >>> 1.1383171081542969
      Signed-off-by: NAmador Pahim <apahim@redhat.com>
      970d850a
    • A
      DataSize: simplify __init__ · 5a1b7133
      Amador Pahim 提交于
      Instead of using regex to parse the `data`, let's use a simpler and more
      performatic version witch just handles the last character to figure out
      the unit.
      
      Before this patch:
      
      >>> timeit.timeit('data_structures.DataSize("1M").b',
                        setup='from avocado.utils import data_structures',
                        number=1000000)
      >>> 2.988218069076538
      
      After this patch:
      
      >>> timeit.timeit('data_structures.DataSize("1M").b',
                        setup='from avocado.utils import data_structures',
                        number=1000000)
      >>> 2.0695440769195557
      Signed-off-by: NAmador Pahim <apahim@redhat.com>
      5a1b7133
  6. 19 4月, 2018 6 次提交
  7. 18 4月, 2018 4 次提交
  8. 16 4月, 2018 2 次提交