Skip to content

Conversation

@n0nag0n
Copy link
Collaborator

@n0nag0n n0nag0n commented Aug 17, 2025

Added some micro optimizations for a class that's used a ton on every request.

@n0nag0n n0nag0n requested a review from Copilot August 17, 2025 17:06
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 implements micro optimizations for the Request class, which is heavily used on every request. The changes focus on improving performance through more efficient data access patterns and reduced function calls.

  • Replaces static method calls with instance methods to reduce overhead
  • Optimizes URL parsing logic by avoiding unnecessary parse_url() calls
  • Consolidates repeated $_SERVER access through centralized getVar() method

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
flight/net/Request.php Core optimizations including instance method usage, improved URL parsing, and consolidated server variable access
flight/net/Response.php Uses centralized getVar() method for accessing server protocol
flight/Engine.php Replaces direct $_SERVER access with Request object method for last modified header
tests/RequestTest.php Adds test coverage for URL encoding, base path handling, and empty query string parsing

@n0nag0n n0nag0n merged commit 69b50fc into master Aug 19, 2025
6 checks passed
@n0nag0n n0nag0n deleted the misc-improvements branch August 19, 2025 12:54
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