winzik/engine/tests/Util
Repository files (latest commit first)
Filename Latest commit message Latest commit date
David Nurdin 8dbf47c023 Color::of(): 8x faster for strings, no array copy for lists, same results
- a colour read from a string is kept (Color is immutable, so one instance is shared): ~20 ns instead of ~170-235 ns
  per call, and 100 000 kept results take 2 MB instead of 14 MB; at most 1024 kept, the cache starts over when full
- only clean hex strings are kept: hexdec() still warns about '#zz0000' each time, as before
- [r, g, b, a] lists skip array_values()
- ColorOfTest compares it with the old function over 3000+ strings and odd arrays

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01UZqwpHZaasov261cZ96aQf
2026-11-10 23:37:16 +01:00
..
ColorOfTest.php Color::of(): 8x faster for strings, no array copy for lists, same results 2026-11-10 23:37:16 +01:00
MiscTest.php JumPHP: PHP framework for retro 2D games (desktop + WebAssembly) 2026-10-27 18:11:08 +01:00