Dan Kenigsberg has submitted this change and it was merged.

Change subject: api: Speed up schema loading
......................................................................


api: Speed up schema loading

Use yaml.CLoader for 13x speedup in vdsm schema loading.

Here is a comparison with other formats:

$ python bench.py

      yaml: 1.053720 seconds per load
     cyaml: 0.086472 seconds per load
      json: 0.049521 seconds per load
    pickle: 0.001516 seconds per load

$ python3 bench.py

      yaml: 1.340607 seconds per load
     cyaml: 0.100010 seconds per load
      json: 0.026627 seconds per load
    pickle: 0.002153 seconds per load

$ grep 'model name' /proc/cpuinfo | head -n1
model name      : Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz

Clearly the best format is pickle, 700X times faster on python 2 and
638X times faster on python 3. However loading the schema in 100
milliseconds seems to be good enough for now.

The benchmark script:
https://bugzilla.redhat.com/attachment.cgi?id=1208141

Change-Id: I230fb88c279973f542f6e1cac17f43ff6f0d2f62
Bug-Url: https://bugzilla.redhat.com/1381899
Signed-off-by: Nir Soffer <nsof...@redhat.com>
Reviewed-on: https://gerrit.ovirt.org/65230
Reviewed-by: Simone Tiraboschi <stira...@redhat.com>
Continuous-Integration: Jenkins CI
Reviewed-by: Piotr Kliczewski <piotr.kliczew...@gmail.com>
Tested-by: Simone Tiraboschi <stira...@redhat.com>
Reviewed-on: https://gerrit.ovirt.org/65274
Reviewed-by: Dan Kenigsberg <dan...@redhat.com>
Reviewed-by: Francesco Romani <from...@redhat.com>
---
M lib/api/vdsmapi.py
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Piotr Kliczewski: Looks good to me, but someone else must approve
  Nir Soffer: Verified
  Jenkins CI: Passed CI tests
  Dan Kenigsberg: Looks good to me, approved
  Francesco Romani: Looks good to me, but someone else must approve



-- 
To view, visit https://gerrit.ovirt.org/65274
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I230fb88c279973f542f6e1cac17f43ff6f0d2f62
Gerrit-PatchSet: 2
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.0
Gerrit-Owner: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: Francesco Romani <from...@redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Nir Soffer <nsof...@redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczew...@gmail.com>
Gerrit-Reviewer: Yaniv Bronhaim <ybron...@redhat.com>
Gerrit-Reviewer: gerrit-hooks <automat...@ovirt.org>
_______________________________________________
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org

Reply via email to