Skip to content

perf: don't read the full file for OSFileSystem._is_marimo_file#8253

Merged
mscolnick merged 4 commits intomainfrom
ms/more-performant-_is_marimo_file
Feb 10, 2026
Merged

perf: don't read the full file for OSFileSystem._is_marimo_file#8253
mscolnick merged 4 commits intomainfrom
ms/more-performant-_is_marimo_file

Conversation

@mscolnick
Copy link
Contributor

@mscolnick mscolnick commented Feb 10, 2026

Re-use the is_marimo_file util from directory scanner which is a bit better / more correct.

@vercel
Copy link

vercel bot commented Feb 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Feb 10, 2026 5:54pm

Request Review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates marimo app-file detection to avoid reading entire files when determining whether a path is a marimo app, and adds tests to cover Python + Markdown detection paths.

Changes:

  • Delegate OSFileSystem._is_marimo_file() to the shared directory_scanner.is_marimo_app() helper.
  • Add test coverage for _is_marimo_file() behavior across .py, .md, other extensions, and missing files.
  • Minor refactors: avoid repeated .lower() calls in search(), and avoid repeated app.to_py() calls during HTML export.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/_server/files/test_os_file_system.py Adds tests for _is_marimo_file() and verifies list_files() marks Markdown marimo notebooks.
marimo/_server/files/os_file_system.py Switches marimo file detection to use is_marimo_app(); minor search() micro-optimization.
marimo/_server/export/exporter.py Computes app.to_py() once and reuses the result for code and hashing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mscolnick mscolnick merged commit f902f32 into main Feb 10, 2026
35 of 43 checks passed
@mscolnick mscolnick deleted the ms/more-performant-_is_marimo_file branch February 10, 2026 18:21
@github-actions
Copy link

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.19.10-dev41

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

3 participants