This repository is a fork of articles-2-pdf-benchmark
This repository contains the benchmark tests for comparing the performance of 3 PDF generation libraries: Dompdf, Puppeteer and Wkhtmltopdf.
To run the benchmark tests, follow these steps:
-
Build the Docker containers for Puppeteer and wkhtmltopdf using the respective Dockerfiles.
cd php-dompdf docker build -t php-dompdf . --platform linux/amd64 cd ../php-puppeteer docker build -t php-puppeteer . --platform linux/amd64 cd ../php-wkhtmltopdf docker build -t php-wkhtmltopdf . --platform linux/amd64 cd ..
-
Run the containers with PDF generation endpoints (
puppeteer.js
andwkhtmltopdf.js
).docker run -dp 3000:80 --name php-dompdf php-dompdf docker run -dp 3001:80 --name php-puppeteer php-puppeteer docker run -dp 3002:80 --name php-wkhtmltopdf php-wkhtmltopdf
-
Gather the Docker stats using the
stats.sh
script../k6/stats.sh
-
Run the k6 load tests using the
loadtests.sh
script../k6/loadtests.sh
-
Analyze the results and compare the performance of the 3 libraries.
-
cleanup
docker stop php-dompdf php-puppeteer php-wkhtmltopdf docker rm php-dompdf php-puppeteer php-wkhtmltopdf rm docker_stats.txt
If you have suggestions, improvements, or other contributions, feel free to submit a pull request or open an issue.
This project is licensed under the MIT License.