Repository navigation
Conversation
Signed-off-by: Garry Drankovich <[email protected]>
Signed-off-by: Garry Drankovich <[email protected]>
Signed-off-by: Garry Drankovich <[email protected]>
This should be more efficient as building std::set implies multiple allocations and rebalancing. Signed-off-by: Garry Drankovich <[email protected]>
Using vector is apparently more efficient as std::set implies more complicated insertion/removal ops (e.g. multiple allocations are required) comparing to vector while the need for keys uniqueness/ordering is pretty rare. Additionally some redundant copyings have been removed as well. Signed-off-by: Garry Drankovich <[email protected]>
Signed-off-by: Garry Drankovich <[email protected]>
|
Can one of the admins verify this patch? |
ronen-fr
left a comment
There was a problem hiding this comment.
Please separate into multiple PRs, as the following should be discussed & verified for each group of changes:
-
is there indeed a performance benefit?
-
are we sure there is no implicit assumption of uniqueness (which is guaranteed when using set/map)?
-
the 'no order is required';
-
performance benefit vs. interface complexity.
I would guess that most of the changes suggested can pass these questions - but they must be discussed.
rzarzynski
left a comment
There was a problem hiding this comment.
I agree with @ronen-fr it would be easier to review / merge if we split the PR.
| return; | ||
| } | ||
| proxyread_ops.erase(tid); | ||
| proxyread_ops.erase(p); |
There was a problem hiding this comment.
This change is in the cache tiering code. Please note it has been deprecated long time ago and we're in the process of removing its tests, so I would prefer to leave it alone.
| pg->snap_trimq.erase(snap_to_trim); | ||
|
|
||
| if (pg->snap_trimq_repeat.count(snap_to_trim)) { | ||
| auto it = pg->snap_trimq_repeat.find(snap_to_trim); |
There was a problem hiding this comment.
nit: better to use the recent C++ feature and put the initialization statement within if (e.g. if (auto it = ...; the check). That way we would limit the scope of it and potentially avoid use-after-invalidate in the future.
| if (it != pg->snap_trimq_repeat.end()) { | ||
| ldout(pg->cct, 10) << " removing from snap_trimq_repeat" << dendl; | ||
| pg->snap_trimq_repeat.erase(snap_to_trim); | ||
| pg->snap_trimq_repeat.erase(it); |
There was a problem hiding this comment.
Yeah, this commit probably makes sense.
| void omap_rmkeys( | ||
| const coll_t &cid, ///< [in] Collection containing oid | ||
| const ghobject_t &oid, ///< [in] Object from which to remove the omap | ||
| const std::vector<std::string> &keys ///< [in] Keys to clear |
| _op->op = OP_OMAP_RMKEYS; | ||
| _op->cid = _get_coll_id(cid); | ||
| _op->oid = _get_object_id(oid); | ||
| encode(keys, data_bl); |
There was a problem hiding this comment.
Although there is some compatibility in marshaling between the types, what needs further checking is:
- dealing with duplicates,
- whether
OP_OMAP_RMKEYSis truly indifferent towards the key order.
| set<string> to_remove; | ||
| to_remove.insert(to_object_key(oid)); | ||
| vector<string> to_remove; | ||
| to_remove.emplace_back(to_object_key(oid)); |
There was a problem hiding this comment.
Perhaps still worth reserving.
|
This pull request has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs for another 30 days. |
|
This pull request has been automatically closed because there has been no activity for 90 days. Please feel free to reopen this pull request (or open a new one) if the proposed change is still appropriate. Thank you for your contribution! |
We don't care about strong ordering in the affected cases while insertions/appends to vector (particularly preallocated one) are more efficient.
Some redundant data clonings and lookup have been eliminated too.
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job Definition