• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

chop-dbhi / avocado / 691
80%

Build:
DEFAULT BRANCH: master
Ran 15 Feb 2015 08:14PM UTC
Jobs 4
Files 67
Run time 153min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
691

Pull #306

travis-ci

bruth
Refactor formatter and exporter APIs to reduce overhead

A call to formatter(...) was doing a lot of work for every row being
processed. The primary slow spots are:

- Format methods being dynamically accessed via getattr() on every loop
- Unpacking keyword arguments (**kwargs) in the method call
- Building and moving OrderedDict values
- Logging a message when a value failed be coerced

To remediate these issues, targeted format methods are now processed
at initialization rather that process time. This requires the list of
formats to be passed into the constructor and not in the __call__ method.

Keyword arguments passed in during a call are no longer unpacked in the
method call, but are passed as a keyword argument itself, `kwargs`.

Use of OrderedDict has been removed in favor of a lightweight namedtuple
class as input (for named values) and plain tuples for output. Value
fields are now defined in the `get_*_header` methods. A custom method
can be implemented per format type.

Exceptions that occur during formatting are no long silently skipped
unless the `ExpectedFormatterException` is used.

The exporters have been updated to accommodate this changes. In addition,
new read methods have been implemented for performance testing including
cached and threaded versions. The previous read method have been renamed
to manual_read since it performs manual limit and offsetting and distinct
checking.

To accommodate the new read method, the `write` on all exporters have been
changed to not call `read` itself. This change requires the passed iterable
to already contain the formatted rows.

Note: This refactor requires backwards incompatible changes to get the
performance gains.

Signed-off-by: Byron Ruth <b@devel.io>
Pull Request #306: Refactor formatter to reduce overhead

204 of 204 new or added lines in 9 files covered. (100.0%)

3172 of 3893 relevant lines covered (81.48%)

3.26 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
100.0
avocado/export/_base.py
3
100.0
avocado/export/_sas.py
4
100.0
avocado/export/_r.py
10
100.0
avocado/formatters.py

Uncovered Existing Lines

Lines Coverage ∆ File
1
100.0
avocado/formatters.py
1
100.0
avocado/query/pipeline.py
3
100.0
avocado/export/_json.py
11
100.0
avocado/export/_r.py
Jobs
ID Job ID Ran Files Coverage
1 691.1 (DJANGO=1.5.12 POSTGRES_TEST_USER=postgres POSTGRES_TEST_NAME=avocado MYSQL_TEST_USER=root MYSQL_TEST_NAME=avocado) 15 Feb 2015 10:47PM UTC 0
81.45
Travis Job 691.1
2 691.2 (DJANGO=1.6.10 POSTGRES_TEST_USER=postgres POSTGRES_TEST_NAME=avocado MYSQL_TEST_USER=root MYSQL_TEST_NAME=avocado) 15 Feb 2015 08:14PM UTC 0
81.45
Travis Job 691.2
3 691.3 (DJANGO=1.5.12 POSTGRES_TEST_USER=postgres POSTGRES_TEST_NAME=avocado MYSQL_TEST_USER=root MYSQL_TEST_NAME=avocado) 15 Feb 2015 08:15PM UTC 0
81.3
Travis Job 691.3
4 691.4 (DJANGO=1.6.10 POSTGRES_TEST_USER=postgres POSTGRES_TEST_NAME=avocado MYSQL_TEST_USER=root MYSQL_TEST_NAME=avocado) 15 Feb 2015 08:14PM UTC 0
81.3
Travis Job 691.4
Source Files on build 691
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #691
  • Pull Request #306
  • PR Base - master (#689)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc