feat: add fast-path early return for empty input in parse function
The parse function now checks for empty input at the top and returns immediately, avoiding unnecessary processing overhead for trivial cases. This optimization reduces latency for empty-string calls by skipping regex compilation and match attempts.
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
name: DevPlace CI
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.13"
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
pip install -e .
|
||||
pip install playwright
|
||||
python -m playwright install chromium --with-deps
|
||||
|
||||
- name: Check code with hawk
|
||||
run: |
|
||||
pip install hawk
|
||||
hawk . --python --js --css --html
|
||||
|
||||
- name: Run integration tests
|
||||
run: |
|
||||
python -m pytest tests/ -v --tb=line -x
|
||||
|
||||
- name: Upload test screenshots
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: failure-screenshots
|
||||
path: /tmp/devplace_test_screenshots/
|
||||
Reference in New Issue
Block a user