Notes from PHPers Summit 2023
High performance PHP8 at Scale - Max Małecki
- elastica bundle + doctrine - entity update listener problem
- try to include basic performance benchmarks into CI/CD pipeline
- phpbench.com microbenchmarks
- disk - access latency, cpi - io waits, net - dns
- xhprof - easier to use I thought and free
- websockets -> file descriptors problem
- load testing: siege, ab, gatling (programmable scenarios)
- Phil Karlton
- composer autoloader optimizations for prod
- php.ini configuration:
opcache.preload
,opcache.jit
- remember not to spam logs
Continuous Integration: Tips & Tricks - Paul Dragoonis
- run steps in parallel, always prepare for whats coming in later steps (for ex.: prepare base image for use in multiple later steps)
- if using Jenkins - configure perf-optimized mode, AWS EC2 plugin, use spot instances
- split work to Big (24CPU) and Small (4CPU) nodes - use labels to distribute steps
- git - do shallow clone (depth 1), skip fetching tags on feature branches (--no-tags)
- git - quick cleanup of local tree:
git reset --hard [...] && git clean -fdx
- shellcheck, docker compose -f [file] config
- extract all commands / steps into bash scripts
- execute those bash scripts inside ci/cd configuration and any Dockerfile used
- gain repeatability and easier debuggability this way
API Anatomy - Tomasz Kowalczyk
- API is not the same thing as HTTP REST API, API can be exposed by multiple transport protocols
- main perspectives:
- Representation: the way of interaction / usage - transport - protocol
- Expression:
- intent vs. effect
- resource vs. procedure
- fat event vs. thin event
- Contract: naming, units, inability to express invalid state/intent, composition of methods
- Evolution:
- protecting entry-points, avoiding side-channels
- test and verify only observable behavior (do not test internals)
- gherkin
- kierowniku poratujesz dziesiąteczką?
Czego boi sie TechLead? - Karol Kreft
- link to presentation
- give / create safe space for others to thrive and grow
- acknowledge in front of a team that you don't know all the things
- be curious, search for what interests you most
- fear is constant, try to face it
- look at your past experience - see how many fears you've already overcomed
Watch the Clock - Andreas Heigl
- Stella-Maris Solutions
- PSR-20 FIG - ClockInterface::now():
- SystemClock
- FixedClock
- common / shared way to parametrize time across all code - your own and external (non-editable) dependencies
- OS is awesome as long as you are not trying to achieve any political consensus :)
- DateTimeInterface instances can be compared and do not take TZ into account in the process (no need to convert to timestamps before comparing)
Asynchronous PHP - Florian Engelhardt
- bunny/bunny - async communication with RabbitMQ from PHP
- fully async creating and consuming RabbitMQ messages is possible in pure PHP
- ReactPHP - event driven and async programming in PHP
Architecture decisions and their impact - Denis Brumann
- Deptrac - configurable tool for visualising code architecture in form of a DAG
Advanced web layout management - Ivo Lukač
- Netgen - web agency
- Netgen Layouts - product, FOSS vs. enterprise
- enterprise: previews, caching, translations, user roles, scheduling
- you include routes for page editor UI in your SF app
- it composes nicely with usual SF MVC pattern (you still have control over Controller / Twig template)
- built with idea of joining / fetching content from many sources
- data sources <- Netgen Layouts -> website (data source: local / custom / external)
Phel, a native LISP for PHP - Jose Maria Valera Reales
- Phel - comprehensive implementation of Lisp in PHP, transpiles to PHP code
- provides escape hatches / interop with PHP code / composer libraries
- Phel/LISP syntax - looks hard only on the first look but after few minutes is clear
Historia Pewnego Legacy - Adam Michna
- what to do not to die in legacy project
- pick your fights (leave some things as they are)
- work step by step, little by little
- make progress visible to all stakeholders:
- measure stuff: performance, complexity, errors freq, publishing freq
- improvements in measured values = better motivation for dev
- make progress visible to product owner
- to understand how system works: observe how database changes - Debezium, AWS infra for DB streaming
- backup / revert / gradual deploy
- when proposing a change: justify it from product owner's standpoint