ff in my own company called terminal42 gmbh • I am one of the 8 Contao Open Source CMS Core Developers • I attended NeosCon 2020 and was a Neos Award Jury member in 2021! • I love astrophysics, whisky, basketball and music
of every package is installed, is the main task of Composer (composer update) • Researched in mathematics as „Boolean satis fi ability problem“ • Solved using a SAT solver • Composer’s SAT Solver is based on openSUSE's Libzypp* * https://en.opensuse.org/openSUSE:Libzypp_satsolver
• One big AND statement that consists of OR statements • (a OR b) AND (a OR b OR c) AND (a OR -b OR -c) … • (a ∨ b) ∧ (a ∨ b ∨ c) ∧ (a ∨ ¬b ∨ ¬c) • Question: What assignments for the literals (a, b, c) are needed so that the AND statement resolves to true? • There are annual competitions „Literal“ „Clause“
in version 3.0.0 • C = toppings/mozzarella in version 3.1.0 • D = toppings/fresh-basil in version 2.0.0 • E = toppings/fresh-basil in version 2.0.1 (¬A ∨ B ∨ C) ∧ (¬A ∨ D ∨ E) ∧ … (-A || B || C) && (-A || D || E) && …
Rule (clause) pizza/margherita in 1.0.0 requires toppings/mozzarella in 3.0.0 • Repository packagist.org, etc. - provides Package instances • Pool Collection of all Package instances
victim of its own success • Complexity grew with every new release of every package in your dependency tree • Complexity grew through collaboration (= more dependencies) which was now easier than ever
are over 1500 Composer plugins* and Composer provides a Plugin API. • Neos has one too! * https://packagist.org/packages/list.json?type=composer-plugin
Parallel fi le downloads (both metadata as well as packages) • Parallel unzipping of packages • Compiled constraint evaluations • … • Major improvements in dependency resolution
in version 3.0.0 • C = toppings/mozzarella in version 3.1.0 • D = toppings/fresh-basil in version 2.0.0 • E = toppings/fresh-basil in version 2.0.1 (¬A ∨ B ∨ C) ∧ (¬A ∨ D ∨ E) ∧ … There is one rule per require statement 👍
= toppings/mozzarella in version 3.0.0 • C = toppings/mozzarella in version 3.1.0 • D = toppings/fresh-basil in version 2.0.0 • E = toppings/fresh-basil in version 2.0.1 (¬A ∨ ¬B) ∧ (¬A ∨ ¬C) ∧ (¬A ∨ ¬D) ∧ (¬A ∨ ¬E) ∧ … There are as many 2 literal rules per con fl ict statement as there are packages! 😰 (¬A ∨ ¬B ∨ ¬C) ∧ (¬A ∨ ¬D ∨ ¬E) ∧ … (¬A ∨ B ∨ C) ∧ (¬A ∨ D ∨ E) ∧ …
does not install multiple versions of the same package? E.g. toppings/fresh-basil in version 2.0.0 as well as 2.0.1? • Yes! Con fl icts! Every version con fl icts with every other version! • 500 package versions result in 124 750 rules! 😰
icts • It’s impossible for one version to con fl ict with just one of the others. They all con fl ict with each other. Always! • Represents all of them in one single rule per package! • Requires special handling in the Solver • Massive reduction in rules = massive performance improvement 🎉
Only loads the packages referenced (=matching constraint) anywhere in the dependency tree. • Required lots of foundation work by Jordi and Nils on e.g. composer/semver • Massive reduction in packages = less rules = massive performance improvement 🎉
are well maintained (= lots of bug fi x releases) • Most bug fi x releases de fi ne identical dependencies • Goal: Remove packages in the pool in order to reduce the number of rules built for them (= exponential reduction!)
From 5 593 094 to 82 422 rules (1.5%) From 3.5GB to 175MB RAM (5%) From 88s to 10s (11%) 3 million (!) „composer update“ per day! That’s a huge win! 🌎 🎉