Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env.benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
DB_DRIVER=sqlite
DB_DATABASE=:memory:
DB_HOST=
DB_PORT=
DB_USERNAME=
DB_PASSWORD=
92 changes: 92 additions & 0 deletions Dockerfile.benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Dockerfile for Express PHP Benchmarks
# Standardized environment for consistent performance testing

FROM php:8.4-cli

# Install system dependencies
RUN apt-get update && apt-get install -y \
git \
curl \
libzip-dev \
zip \
unzip \
libicu-dev \
libonig-dev \
libxml2-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Install PHP extensions
RUN docker-php-ext-install \
pdo \
pdo_mysql \
mysqli \
bcmath \
intl \
opcache \
zip \
mbstring \
xml

# Install PECL extensions
RUN pecl install redis apcu && \
docker-php-ext-enable redis apcu

# Configure OPcache for maximum performance
RUN { \
echo 'opcache.enable=1'; \
echo 'opcache.enable_cli=1'; \
echo 'opcache.memory_consumption=256'; \
echo 'opcache.interned_strings_buffer=16'; \
echo 'opcache.max_accelerated_files=20000'; \
echo 'opcache.validate_timestamps=0'; \
echo 'opcache.save_comments=0'; \
echo 'opcache.fast_shutdown=1'; \
echo 'opcache.jit_buffer_size=256M'; \
echo 'opcache.jit=1255'; \
} > /usr/local/etc/php/conf.d/opcache-recommended.ini

# Configure APCu
RUN { \
echo 'apc.enable_cli=1'; \
echo 'apc.shm_size=256M'; \
} > /usr/local/etc/php/conf.d/apcu.ini

# Configure PHP for performance
RUN { \
echo 'memory_limit=1G'; \
echo 'max_execution_time=0'; \
echo 'date.timezone=UTC'; \
echo 'display_errors=Off'; \
echo 'error_reporting=E_ALL & ~E_DEPRECATED & ~E_STRICT'; \
} > /usr/local/etc/php/conf.d/performance.ini

# Install Composer
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer

# Set working directory
WORKDIR /app

# Copy composer files first for better caching
COPY composer.json composer.lock ./

# Install dependencies
RUN composer install --no-dev --optimize-autoloader --no-interaction --no-progress

# Copy application code
COPY . .

# Warm up OPcache by preloading files
RUN find src -name "*.php" -exec php -l {} \; > /dev/null 2>&1

# Create benchmark results directory
RUN mkdir -p /app/benchmarks/results

# Set environment variables for consistent benchmarking
ENV PHP_MEMORY_LIMIT=1G \
PHP_MAX_EXECUTION_TIME=0 \
BENCHMARK_ITERATIONS=10000 \
BENCHMARK_WARMUP=1000

# Default command
CMD ["php", "-d", "memory_limit=1G", "-d", "opcache.enable_cli=1", "benchmarks/run_all_benchmarks.php"]
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

**Express PHP** é um microframework moderno, leve e seguro, inspirado no Express.js, para construir APIs e aplicações web de alta performance em PHP. Foco em produtividade, arquitetura desacoplada e extensibilidade real.

- **Alta Performance**: +52M ops/sec em CORS, +24M ops/sec em Response, cache integrado e roteamento otimizado.
- **Alta Performance**: 2.57M ops/sec em CORS, 2.27M ops/sec em Response, 757K ops/sec roteamento, cache integrado.
- **Arquitetura Moderna**: DI Container, Service Providers, Event System, Extension System e PSR-15.
- **Segurança**: Middlewares robustos para CSRF, XSS, Rate Limiting, JWT, API Key e mais.
- **Extensível**: Sistema de plugins, hooks, providers e integração PSR-14.
Expand Down Expand Up @@ -44,7 +44,7 @@
- Sistemas extensíveis com plugins e hooks
- Plataformas que exigem segurança e performance

Veja exemplos práticos em [`examples/`](examples/) e benchmarks reais em [`benchmarks/`](benchmarks/).
Veja exemplos práticos em [`examples/`](examples/), benchmarks reais em [`benchmarks/`](benchmarks/) e [relatório de performance completo](docs/performance/PERFORMANCE_REPORT_v2.1.3.md).

---

Expand Down
Loading