Skip to content

Vectorize row-wise applies#234

Merged
jtec merged 12 commits into
mainfrom
vectorize_applies
Jun 25, 2026
Merged

Vectorize row-wise applies#234
jtec merged 12 commits into
mainfrom
vectorize_applies

Conversation

@jtec

@jtec jtec commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Turns out about 25% of prx's run time are calls to timedelta_2_seconds which is called row-wise in a few places. This PR vectorizes timedelta_2_seconds and makes a few other cosmetic changes.

Before

Screenshot 2026-06-17 at 22 18 10

After

Screenshot 2026-06-17 at 22 27 23

Note the unexpectedly large reduction in run time - did not check whether that is variability of our benchmark or additional overhead associated to calling .apply that goes away with this change.

jtec added 5 commits June 17, 2026 21:14
PASSED  [100%]2026-06-17 21:13:31,815 [DEBUG] [prx.util]: Function
handle_bds_geos took 0 days 00:00:24.540819 to run.
2026-06-17 21:13:34,538 [DEBUG] [prx.util]: Function
handle_bds_geos_faster took 0 days 00:00:02.708934 to run.
@jtec jtec changed the base branch from main to faster_rotations June 17, 2026 20:21

def test_parse_nav_file(input_for_test):
path_to_rnx3_nav_file = converters.anything_to_rinex_3(input_for_test["nav"])
disk_cache.clear()

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not actually calling the parser if the nav file was cached.

@jtec jtec changed the base branch from faster_rotations to main June 19, 2026 08:00
f"Unexpected types: time is {type(time)}, timescale is {type(timescale)}"
def to_isagpst(
time: pd.Timedelta | pd.Series,
timescale: str,

@jtec jtec Jun 19, 2026

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function is actually only ever called with a timescale string, so removed the code for handling Series of timescales.

@jtec jtec requested a review from plutonheaven June 19, 2026 08:25
@jtec jtec marked this pull request as ready for review June 19, 2026 08:28
Comment thread src/prx/test/test_util.py

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a test_helpers.py that refers to before utils.py was renamed from helpers.py. We may want to fuse both files (test_helpers.py and test_util.py).

@jtec jtec Jun 25, 2026

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good call, done!

@jtec jtec merged commit 08631a0 into main Jun 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants