Skip to content

Conversation

@mpkorstanje
Copy link
Contributor

@mpkorstanje mpkorstanje commented Sep 30, 2025

🤔 What's changed?

Creating a FileSource involves a call to File.getCanonicalFile. This call can be slow because it involves the file system. Especially if the file system is networked.

By using FileSource.withPosition we can reuse the canonical file from the feature for its nodes.

⚡️ What's your motivation?

Fixes: #3010

🏷️ What kind of change is this?

  • 🐛 Bug fix (non-breaking change which fixes a defect)

📋 Checklist:

  • I agree to respect and uphold the Cucumber Community Code of Conduct
  • I've changed the behaviour of the code
    • I have added/updated tests to cover my changes.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • Users should know about my change
    • I have added an entry to the "Unreleased" section of the CHANGELOG, linking to this pull request.

@mpkorstanje mpkorstanje marked this pull request as ready for review September 30, 2025 12:17
Creating a `FileSource` involves a call to `File.getCanonicalFile`.
This call can be slow because it involves the file system. Especially
if the file system is networked.

By using `FileSource.withPosition` we can reuse the canonical file from
the feature for its nodes.

Fixes: #3010
@mpkorstanje mpkorstanje force-pushed the junit-platform-use-file-source-with-position branch from 44b67e1 to 8d5a508 Compare September 30, 2025 12:18
@mpkorstanje mpkorstanje merged commit a8470cb into main Sep 30, 2025
7 checks passed
@mpkorstanje mpkorstanje deleted the junit-platform-use-file-source-with-position branch September 30, 2025 13:09
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.

High Overhead in FileFeatureOrigin Caused by Repeated Canonical File Resolution

1 participant