Загрузка...

Understanding Regex Optimizations in Doctrine DBAL 3.10

Subscribe to my newsletter for PHP performance content: https://tideways.com/newsletter?utm_source=yt&utm_campaign=yt-regexp

Try our PHP Profiler: https://tideways.com/profiler/features?utm_source=yt&utm_campaign=yt-regexp

Regular expressions are usually not top of mind when you think of performance bottlenecks in your application, but inefficient patterns or sub-optimal use of the APIs can make them slow.

A wonderful learning opportunity for this is a recent performance improvement patch to Doctrine DBAL’s SQL Parser.

Using a combined pattern with named capture groups, the PR discussed in this video simplified the parsing process and reduced the number of calls to preg_match and other functions considerably leading to an improvement by a factor of 2.3

00:00 Introduction
00:30 The Patch Explained
03:37 Doctrine Array Parameters explained
05:04 Measuring Impact with Hyperfine
08:28 Combining Regular Expressions

Blog Post: https://tideways.com/profiler/blog/combining-regular-expressions-with-named-capture-groups-to-improve-performance

Pull Request: https://github.com/doctrine/dbal/pull/6926

🚀 🕵️ Try the 14 days free trial of Tideways PHP Profiler: https://app.tideways.io/register

Видео Understanding Regex Optimizations in Doctrine DBAL 3.10 канала Tideways
Яндекс.Метрика
Все заметки Новая заметка Страницу в заметки
Страницу в закладки Мои закладки
На информационно-развлекательном портале SALDA.WS применяются cookie-файлы. Нажимая кнопку Принять, вы подтверждаете свое согласие на их использование.
О CookiesНапомнить позжеПринять