Keyboard Shortcuts

File
u :up to issue
m :publish + mail comments
M :edit review message
j / k :jump to file after / before current file
J / K :jump to next file with a comment after / before current file
Side-by-side diff
i :toggle intra-line diffs
e :expand all comments
c :collapse all comments
s :toggle showing all comments
n / p :next / previous diff chunk or comment
N / P :next / previous comment
<Up> / <Down> :next / previous line
<Enter> :respond to / edit current comment
d :mark current comment as done
Issue
u :up to list of issues
m :publish + mail comments
j / k :jump to patch after / before current patch
o / <Enter> :open current patch in side-by-side view
i :open current patch in unified diff view
Issue List
j / k :jump to issue after / before current issue
o / <Enter> :open current issue
# : close issue
Comment/message editing
<Ctrl> + s or <Ctrl> + Enter :save comment
<Esc> :cancel edit
Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(171)
Issues Repositories Search
Open Issues | Closed Issues | All Issues | Sign in with your Google Account to create issues and add comments

Issue 6493100: ensure use of py yaml c extension for speed.

Can't Edit
Can't Publish+Mail
Start Review
Created:
13 years, 4 months ago by hazmat
Modified:
13 years, 3 months ago
Reviewers:
gz, mp+123470, jimbaker
Visibility:
Public.
ensure use of py yaml c extension for speed. Backwards compatible. Drops test time in half. Should improve speed across the board, things like status will see marked improvements. https://code.launchpad.net/~hazmat/juju/fast-yaml/+merge/123470 (do not edit description out of merge proposal)

Patch Set 1 #

Total comments: 5

Patch Set 2 : ensure use of py yaml c extension for speed. #

Total comments: 2
Created: 13 years, 3 months ago
Download [raw] [tar.bz2]
Unified diffs Side-by-side diffs Delta from patch set Stats (+448 lines, -411 lines) Patch
A [revision details] View 1 1 chunk +2 lines, -0 lines 0 comments Download
M juju/agents/tests/test_unit.py View 3 chunks +2 lines, -2 lines 0 comments Download
M juju/charm/config.py View 1 2 chunks +4 lines, -3 lines 0 comments Download
M juju/charm/metadata.py View 1 2 chunks +5 lines, -2 lines 0 comments Download
M juju/charm/tests/test_base.py View 1 2 chunks +6 lines, -4 lines 0 comments Download
M juju/charm/tests/test_bundle.py View 1 3 chunks +5 lines, -5 lines 0 comments Download
M juju/charm/tests/test_config.py View 1 7 chunks +10 lines, -8 lines 0 comments Download
M juju/charm/tests/test_directory.py View 1 3 chunks +3 lines, -3 lines 0 comments Download
M juju/charm/tests/test_metadata.py View 1 3 chunks +4 lines, -3 lines 0 comments Download
M juju/charm/tests/test_publisher.py View 1 3 chunks +3 lines, -3 lines 0 comments Download
M juju/control/config_set.py View 1 2 chunks +2 lines, -2 lines 0 comments Download
M juju/control/constraints_get.py View 1 2 chunks +3 lines, -2 lines 0 comments Download
M juju/control/deploy.py View 1 3 chunks +2 lines, -3 lines 0 comments Download
M juju/control/initialize.py View 2 chunks +2 lines, -2 lines 0 comments Download
M juju/control/status.py View 2 chunks +4 lines, -2 lines 0 comments Download
M juju/control/tests/test_add_unit.py View 1 2 chunks +2 lines, -3 lines 0 comments Download
M juju/control/tests/test_bootstrap.py View 1 1 chunk +2 lines, -2 lines 0 comments Download
M juju/control/tests/test_config_get.py View 1 3 chunks +3 lines, -5 lines 0 comments Download
M juju/control/tests/test_config_set.py View 1 4 chunks +9 lines, -10 lines 0 comments Download
M juju/control/tests/test_constraints_get.py View 7 chunks +7 lines, -8 lines 0 comments Download
M juju/control/tests/test_deploy.py View 10 chunks +10 lines, -11 lines 0 comments Download
M juju/control/tests/test_destroy_environment.py View 1 chunk +1 line, -1 line 0 comments Download
M juju/control/tests/test_expose.py View 2 chunks +2 lines, -2 lines 0 comments Download
M juju/control/tests/test_initialize.py View 2 chunks +3 lines, -3 lines 0 comments Download
M juju/control/tests/test_open_tunnel.py View 1 chunk +3 lines, -2 lines 0 comments Download
M juju/control/tests/test_remove_relation.py View 2 chunks +2 lines, -2 lines 0 comments Download
M juju/control/tests/test_scp.py View 1 chunk +0 lines, -1 line 0 comments Download
M juju/control/tests/test_status.py View 1 6 chunks +6 lines, -6 lines 0 comments Download
M juju/control/tests/test_unexpose.py View 2 chunks +2 lines, -2 lines 0 comments Download
M juju/control/tests/test_upgrade_charm.py View 2 chunks +3 lines, -2 lines 0 comments Download
M juju/control/tests/test_utils.py View 1 2 chunks +1 line, -1 line 0 comments Download
M juju/environment/config.py View 2 chunks +2 lines, -2 lines 2 comments Download
M juju/environment/tests/test_config.py View 26 chunks +55 lines, -54 lines 0 comments Download
M juju/hooks/protocol.py View 3 chunks +4 lines, -3 lines 0 comments Download
M juju/hooks/scheduler.py View 3 chunks +4 lines, -3 lines 0 comments Download
M juju/hooks/tests/test_cli.py View 2 chunks +3 lines, -2 lines 0 comments Download
M juju/hooks/tests/test_invoker.py View 7 chunks +6 lines, -6 lines 0 comments Download
M juju/hooks/tests/test_scheduler.py View 18 chunks +19 lines, -20 lines 0 comments Download
M juju/lib/format.py View 2 chunks +3 lines, -3 lines 0 comments Download
A juju/lib/serializer.py View 1 1 chunk +21 lines, -0 lines 0 comments Download
M juju/providers/common/cloudinit.py View 2 chunks +3 lines, -2 lines 0 comments Download
M juju/providers/common/state.py View 3 chunks +4 lines, -3 lines 0 comments Download
M juju/providers/common/tests/test_cloudinit.py View 2 chunks +3 lines, -3 lines 0 comments Download
M juju/providers/common/tests/test_findzookeepers.py View 2 chunks +2 lines, -2 lines 0 comments Download
M juju/providers/common/tests/test_state.py View 3 chunks +4 lines, -3 lines 0 comments Download
M juju/providers/common/tests/test_utils.py View 2 chunks +2 lines, -2 lines 0 comments Download
M juju/providers/common/utils.py View 2 chunks +3 lines, -2 lines 0 comments Download
M juju/providers/ec2/tests/common.py View 3 chunks +2 lines, -2 lines 0 comments Download
M juju/providers/ec2/tests/test_bootstrap.py View 3 chunks +4 lines, -5 lines 0 comments Download
M juju/providers/ec2/tests/test_findzookeeper.py View 1 chunk +1 line, -2 lines 0 comments Download
M juju/providers/ec2/tests/test_launch.py View 3 chunks +3 lines, -4 lines 0 comments Download
M juju/providers/ec2/tests/test_provider.py View 1 chunk +1 line, -0 lines 0 comments Download
M juju/providers/ec2/tests/test_state.py View 5 chunks +6 lines, -6 lines 0 comments Download
M juju/providers/local/files.py View 3 chunks +3 lines, -4 lines 0 comments Download
M juju/providers/local/tests/test_agent.py View 1 chunk +1 line, -2 lines 0 comments Download
M juju/providers/local/tests/test_container.py View 1 chunk +1 line, -0 lines 0 comments Download
M juju/providers/local/tests/test_files.py View 2 chunks +3 lines, -2 lines 0 comments Download
M juju/providers/openstack/tests/test_bootstrap.py View 4 chunks +4 lines, -8 lines 0 comments Download
M juju/providers/openstack/tests/test_launch.py View 2 chunks +2 lines, -2 lines 0 comments Download
M juju/providers/openstack/tests/test_state.py View 4 chunks +4 lines, -5 lines 0 comments Download
M juju/providers/orchestra/tests/common.py View 1 chunk +2 lines, -1 line 0 comments Download
M juju/providers/orchestra/tests/test_bootstrap.py View 1 chunk +1 line, -1 line 0 comments Download
M juju/providers/orchestra/tests/test_findzookeepers.py View 1 chunk +1 line, -2 lines 0 comments Download
M juju/providers/orchestra/tests/test_state.py View 1 chunk +1 line, -1 line 0 comments Download
M juju/state/charm.py View 4 chunks +4 lines, -4 lines 0 comments Download
M juju/state/environment.py View 5 chunks +7 lines, -6 lines 0 comments Download
M juju/state/hook.py View 1 chunk +1 line, -2 lines 0 comments Download
M juju/state/machine.py View 2 chunks +2 lines, -2 lines 0 comments Download
M juju/state/relation.py View 7 chunks +8 lines, -8 lines 0 comments Download
M juju/state/security.py View 6 chunks +6 lines, -5 lines 0 comments Download
M juju/state/service.py View 15 chunks +24 lines, -21 lines 0 comments Download
M juju/state/tests/test_charm.py View 3 chunks +3 lines, -2 lines 0 comments Download
M juju/state/tests/test_environment.py View 6 chunks +9 lines, -7 lines 0 comments Download
M juju/state/tests/test_hook.py View 16 chunks +19 lines, -20 lines 0 comments Download
M juju/state/tests/test_machine.py View 4 chunks +5 lines, -6 lines 0 comments Download
M juju/state/tests/test_relation.py View 7 chunks +12 lines, -12 lines 0 comments Download
M juju/state/tests/test_security.py View 5 chunks +4 lines, -4 lines 0 comments Download
M juju/state/tests/test_service.py View 11 chunks +12 lines, -12 lines 0 comments Download
M juju/state/tests/test_topology.py View 3 chunks +3 lines, -4 lines 0 comments Download
M juju/state/tests/test_utils.py View 5 chunks +10 lines, -8 lines 0 comments Download
M juju/state/topology.py View 3 chunks +4 lines, -4 lines 0 comments Download
M juju/state/utils.py View 4 chunks +5 lines, -4 lines 0 comments Download
M juju/unit/lifecycle.py View 4 chunks +3 lines, -3 lines 0 comments Download
M juju/unit/tests/test_lifecycle.py View 3 chunks +3 lines, -2 lines 0 comments Download
M juju/unit/tests/test_workflow.py View 3 chunks +5 lines, -5 lines 0 comments Download
M juju/unit/workflow.py View 6 chunks +8 lines, -8 lines 0 comments Download
Total messages: 4
|
hazmat
Please take a look.
13 years, 4 months ago (2012年09月10日 03:41:21 UTC) #1
Please take a look.
Sign in to reply to this message.
gz
Looks like a good improvement, I like that this also sorts out the confusion over ...
13 years, 4 months ago (2012年09月10日 15:01:54 UTC) #2
Looks like a good improvement, I like that this also sorts out the confusion
over whether to use dump/load or safe_dump/safe_load at the same time.
I would have been tempted to name the wrapper module juju.lib.yaml to avoid
touching most lines, but this way means you did look at all the callers at
least.
There are several callsites that still use the yaml module functions and pass in
a Loader or Dumper, apart from the one noted below, shouldn't they all be
changed to using juju.lib for consistency?
https://codereview.appspot.com/6493100/diff/1/juju/charm/config.py
File juju/charm/config.py (right):
https://codereview.appspot.com/6493100/diff/1/juju/charm/config.py#newcode80
juju/charm/config.py:80: raw_data = yaml.load(data, Loader=yaml.CSafeLoader)
Why not use dump from juju.lib here rather than specifying the loader? Will need
the yaml import for the Mark below anyway, but seems best to consistently use
the same loader.
https://codereview.appspot.com/6493100/diff/1/juju/control/constraints_get.py
File juju/control/constraints_get.py (right):
https://codereview.appspot.com/6493100/diff/1/juju/control/constraints_get.py...
juju/control/constraints_get.py:73: yaml.dump(result, sys.stdout,
Dumper=yaml.CSafeDumper)
I'd dump using the juju.lib function and write to stout separately afterwards
here.
https://codereview.appspot.com/6493100/diff/1/juju/control/status.py
File juju/control/status.py (right):
https://codereview.appspot.com/6493100/diff/1/juju/control/status.py#newcode581
juju/control/status.py:581: data, filelike, default_flow_style=False,
Dumper=yaml.CSafeDumper)
This looks like the only place that really wants extra args to dump, leaving
this as a special case seems fine.
https://codereview.appspot.com/6493100/diff/1/juju/lib/serializer.py
File juju/lib/serializer.py (right):
https://codereview.appspot.com/6493100/diff/1/juju/lib/serializer.py#newcode5
juju/lib/serializer.py:5: def dump(*args, **kw):
I'd be tempted to make this just take a dict rather than passing through args
and kwargs.
https://codereview.appspot.com/6493100/diff/1/juju/lib/serializer.py#newcode9
juju/lib/serializer.py:9: def load(*args, **kw):
Likewise, would make this just take a string.
Sign in to reply to this message.
hazmat
Please take a look.
13 years, 3 months ago (2012年09月14日 15:34:27 UTC) #3
Please take a look.
Sign in to reply to this message.
jimbaker
+1, LGTM, nice speedup and a clean transition to the C extensions. Just need to ...
13 years, 3 months ago (2012年09月14日 16:03:36 UTC) #4
+1, LGTM, nice speedup and a clean transition to the C extensions. Just need to
take care of the two trivials where CSafeLoader/CSafeDumper is used instead of
the equivalent juju.lib.serializer wrappers.
https://codereview.appspot.com/6493100/diff/5002/juju/environment/config.py
File juju/environment/config.py (right):
https://codereview.appspot.com/6493100/diff/5002/juju/environment/config.py#n...
juju/environment/config.py:178: config = yaml.load(content,
Loader=yaml.CSafeLoader)
Use juju.lib.serializer.load instead
https://codereview.appspot.com/6493100/diff/5002/juju/environment/config.py#n...
juju/environment/config.py:313: return yaml.dump(config,
Dumper=yaml.CSafeDumper)
Use juju.lib.serializer.dump instead
Sign in to reply to this message.
|
Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b

AltStyle によって変換されたページ (->オリジナル) /