ENH: Add PDB reader benchmark to track parsing performance#5394
ENH: Add PDB reader benchmark to track parsing performance#5394Dreamstick9 wants to merge 4 commits into
Conversation
Documentation build overview
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #5394 +/- ##
========================================
Coverage 93.85% 93.85%
========================================
Files 182 182
Lines 22509 22509
Branches 3202 3202
========================================
Hits 21125 21125
Misses 922 922
Partials 462 462 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| self.u = mda.Universe(PDB) | ||
|
|
||
| def time_iterate(self, n_frames): | ||
| for _ in range(n_frames): |
There was a problem hiding this comment.
Maybe I'm mistaken, but won't this nested loop do something weird?
- for each integer in
n_framesrange - loop over the entire trajectory--all frames, since
u.trajectoryisn't sliced
Now, it may be the case that after the first outer loop iteration there's no rewind so you don't redo the full iteration each time, but I'm pretty sure the way this is expressed isn't quite right yet.
Even if you fix that, I'm not entirely certain this is benchmarking what we want on the "reading" side.
There was a problem hiding this comment.
Well the standard PDB file only contains 1 frame, but for a better approach i could use PDB_multiframe (which is an NMR) and MDAnalysis treats all the 3d models in this file as a different frame, which removes the need for the outer loop totally, So @tylerjereddy if this approach seems to be better, shall I go ahead?
There was a problem hiding this comment.
Also added time_read to separately benchmark the initial parse, let me know if this approach is the right direction to move forward with.

Changes made in this Pull Request:
PDBReaderBenchclass tobenchmarks/benchmarks/traj_reader.py.LLM / AI generated code disclosure
LLMs or other AI-powered tools (beyond simple IDE use cases) were used in this contribution: no
PR Checklist
package/CHANGELOGfile updated?package/AUTHORS? (If it is not, add it!)Developers Certificate of Origin
I certify that I can submit this code contribution as described in the Developer Certificate of Origin, under the MDAnalysis LICENSE.