Page MenuHomeSoftware Heritage

use `objstorage is None` instead of `not objstorage`
ClosedPublic

Authored by olasd on Mar 3 2022, 7:53 PM.

Details

Reviewers
vlorentz
Maniphest Tasks
Restricted Maniphest Task
Commits
rDOBJS26201f451e8c: use `objstorage is None` instead of `not objstorage`
Summary

bool(objstorage) uses len(objstorage) != 0, which takes "a little bit"
of time on non-trivial objstorages...

Test Plan

the staging objstorages are not on fire anymore

Diff Detail

Repository
rDOBJS Object storage
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 27268
Build 42654: Phabricator diff pipeline on jenkinsJenkins console · Jenkins
Build 42653: arc lint + arc unit

Event Timeline

Build is green

Patch application report for D7289 (id=26382)

Rebasing onto e90ea3e2cf...

Current branch diff-target is up to date.
Changes applied before test
commit 26201f451e8c39e3b765bb23896dce9b3301b3d1
Author: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date:   Thu Mar 3 19:52:14 2022 +0100

    use `objstorage is None` instead of `not objstorage`
    
    `bool(objstorage)` uses `len(objstorage) != 0`, which takes "a little bit"
    of time on non-trivial objstorages...

See https://jenkins.softwareheritage.org/job/DOBJS/job/tests-on-diff/143/ for more details.

olasd requested review of this revision.Mar 3 2022, 7:56 PM
This revision is now accepted and ready to land.Mar 3 2022, 7:56 PM
vlorentz added a task: Restricted Maniphest Task.Mar 7 2022, 9:25 AM