Skip to content

Add pyinstrument profiling script for Raster.sample() method#405

Draft
Copilot wants to merge 3 commits intodevelopfrom
copilot/add-profiling-script
Draft

Add pyinstrument profiling script for Raster.sample() method#405
Copilot wants to merge 3 commits intodevelopfrom
copilot/add-profiling-script

Conversation

Copy link
Contributor

Copilot AI commented Jan 26, 2026

Adds profiling infrastructure for the Raster.sample() method to support performance optimization work.

Changes

  • New script: scripts/profiling/profile_sample.py profiles sampling operations with 100, 1K, and 10K points on a 1000×1000 raster
  • Output: Interactive HTML reports (gitignored) viewable in browser
  • Usage: uv run python scripts/profiling/profile_sample.py

The script generates detailed call stacks showing time distribution across sampling operations, useful for identifying bottlenecks referenced in the code comment linking to https://rdrn.me/optimising-sampling/.

Original prompt

This section details on the original issue you should resolve

<issue_title>Write a script that profiles .sample() using pyinstrument</issue_title>
<issue_description>Make a scripts/profiling directory to put the script in. Output .gitignored .prof files to visualise using snakeviz</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 26, 2026 22:13
Co-authored-by: b-j-karl <119374704+b-j-karl@users.noreply.github.com>
Co-authored-by: b-j-karl <119374704+b-j-karl@users.noreply.github.com>
Copilot AI changed the title [WIP] Write script to profile .sample() using pyinstrument Add pyinstrument profiling script for Raster.sample() method Jan 26, 2026
Copilot AI requested a review from b-j-karl January 26, 2026 22:16
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.

Write a script that profiles .sample() using pyinstrument

2 participants