Skip to content

Commit

Permalink
Enabled CLI opcode caching and improved opcode invalidation in valida…
Browse files Browse the repository at this point in the history
…tion.

The PHP.ini configuration has been updated to enable opcode caching for CLI (Command Line Interface). This will contribute to better performance when executing PHP scripts from the command line. Additionally, the opcode invalidation logic in the abstract validation class has been modified. Instead of invalidating the cache for schema file paths directly, it now correctly invalidates the cache for their string representation.
  • Loading branch information
SmetDenis committed Apr 9, 2024
1 parent 7c84686 commit e47317d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 63 deletions.
23 changes: 3 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,13 @@ RUN composer install --no-dev \
RUN mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
COPY ./docker/php.ini /usr/local/etc/php/conf.d/docker-z99-php.ini

# Warmup caches
RUN php ./docker/build-preloader.php && php ./docker/preload.php

# Quick test
RUN time ./csv-blueprint --version --ansi \
&& time ./csv-blueprint validate:csv --help --ansi

#RUN time php ./docker/random-csv.php \
# Warmup caches
#RUN php ./docker/build-preloader.php \
# && php ./docker/preload.php \
# && echo "opcache.preload=./docker/preload.php" >> /usr/local/etc/php/conf.d/docker-z99-php.ini
# && time ./csv-blueprint validate:csv -h \
# && time ./csv-blueprint validate:schema \
# --schema=./schema-examples/*.yml \
# --schema=./schema-examples/*.php \
# --schema=./schema-examples/*.json -vvv \
# && echo "Warm up is ready!" \

#RUN time php ./docker/random-csv.php \
# && time ./csv-blueprint validate:csv \
# --schema=./schema-examples/full.yml \
# --csv=./docker/random_data.csv \
# --apply-all=yes \
# --report=text --mute-errors > /dev/null \
# && echo "Tests are ready!" \
# && rm ./docker/random_data.csv \
# && du -sh ./docker

ENTRYPOINT ["/app/csv-blueprint"]
2 changes: 1 addition & 1 deletion docker/php.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ opcache.fast_shutdown = 1
opcache.memory_consumption = 100
opcache.save_comments = 1
opcache.jit_buffer_size=100M
opcache.jit=1255
opcache.jit=tracing

; Experimantal for really quick script start.
; Save opcache data as files on disk inside the Docker image
Expand Down
42 changes: 0 additions & 42 deletions docker/random-csv.php

This file was deleted.

0 comments on commit e47317d

Please sign in to comment.