- Have you ever think how PDO work under the hood?
- What if tomorrow you need to write own DB driver from scratch?
- How to approach such tasks and get around the pitfalls?
- Is it possible to achieve in pure PHP performance comparable to the C extension?
In this talk I will try to answer these and other questions related to the development of clients for various binary protocols. We also analyze the nuances of the asynchronous driver implementation and dive into the world of low-level and not-so-optimizations.
Динамический код: модифицируем таблицу символов во время выполнения. Елена Ши...Moscow.pm
Видео: http://video.mail.ru/corp/p.scherbinin/6/7.html
Tаблица символов — это только небольшой шаг в мир внутреннего устройства Perl, но и он открывает программисту огромные возможности:
— Runtime-кодогенерация.
— Генерация по запросу.
— Изменение кода сторонних модулей на лету и многое другое.
Не верь никому или разработка эффективных приложений (Как писать по настоящем...Moscow.pm
Видео: http://video.mail.ru/corp/p.scherbinin/6/11.html
— Знай свою среду. Почему нужно изучать язык, на котором пишешь.
— Магии нет. Есть непонимание процессов.
— Не верь предрассудкам. Они сложились при других обстоятельствах.
— Доверяй, но проверяй. Прежде, чем использовать решение, проверь.
— Не используй не изучив. Не используй не понимая.
— Код можно менять. Как делать это с умом.
— Можно ли доверять синтетике? Синтетические тесты и реальная нагрузка.
— Немного примеров. Плохих и хороших.
Александр Сомов "C++: препроцессор, компилятор, компоновщик"Yandex
Из этого доклада вы узнаете, как разбирать различные ошибки сборки C++, как их исправлять и что для этого нужно знать.
Речь пойдет о стадиях сборки программы на C++ и о том, как устроены объектные файлы (на примере формата ELF), о работе компилятора и компоновщика, а также особенностях, связанных со спецификой языка. В заключительной части доклада будут разобраны принципы работы препроцессора C++ и способы его отладки.
My talk is about DSLs, their kinds and when it’s worth to be using them. I’ll also demonstrate different approaches to developing internal and external DSLs in Python and will try to give the comparative analysis of those.
Доклад о разработке (а главное - оптимизации) программы на Perl под Raspberry PI.
Наглядно показывает, что в Perl есть немало возможностей, а также инструментов, которые позволяют делать программы быстрее и эффективнее - используя как преимущества самого языка, так и оптимизацию алгоритма программы.
Динамический код: модифицируем таблицу символов во время выполнения. Елена Ши...Moscow.pm
Видео: http://video.mail.ru/corp/p.scherbinin/6/7.html
Tаблица символов — это только небольшой шаг в мир внутреннего устройства Perl, но и он открывает программисту огромные возможности:
— Runtime-кодогенерация.
— Генерация по запросу.
— Изменение кода сторонних модулей на лету и многое другое.
Не верь никому или разработка эффективных приложений (Как писать по настоящем...Moscow.pm
Видео: http://video.mail.ru/corp/p.scherbinin/6/11.html
— Знай свою среду. Почему нужно изучать язык, на котором пишешь.
— Магии нет. Есть непонимание процессов.
— Не верь предрассудкам. Они сложились при других обстоятельствах.
— Доверяй, но проверяй. Прежде, чем использовать решение, проверь.
— Не используй не изучив. Не используй не понимая.
— Код можно менять. Как делать это с умом.
— Можно ли доверять синтетике? Синтетические тесты и реальная нагрузка.
— Немного примеров. Плохих и хороших.
Александр Сомов "C++: препроцессор, компилятор, компоновщик"Yandex
Из этого доклада вы узнаете, как разбирать различные ошибки сборки C++, как их исправлять и что для этого нужно знать.
Речь пойдет о стадиях сборки программы на C++ и о том, как устроены объектные файлы (на примере формата ELF), о работе компилятора и компоновщика, а также особенностях, связанных со спецификой языка. В заключительной части доклада будут разобраны принципы работы препроцессора C++ и способы его отладки.
My talk is about DSLs, their kinds and when it’s worth to be using them. I’ll also demonstrate different approaches to developing internal and external DSLs in Python and will try to give the comparative analysis of those.
Доклад о разработке (а главное - оптимизации) программы на Perl под Raspberry PI.
Наглядно показывает, что в Perl есть немало возможностей, а также инструментов, которые позволяют делать программы быстрее и эффективнее - используя как преимущества самого языка, так и оптимизацию алгоритма программы.
Николай Паламарчук "Functional Programming basics for PHP developers"Fwdays
Functional Programming becomes very popular nowadays. What is it? Is it a hype or panacea? Should you deal with it as a PHP programmer? Let's find out!
Надежный обмен данными в гетерогенной среде, между разными платформами и технологиями является одним из ключевых моментов разработки сложных систем. Во время обмена данные преобразуются в некоторый промежуточный формат совместимый между платформами. Преобразование в подобный формат и из него — крайне рутинная и подверженная ошибкам работа.
Метаописание данных неким декларативным языком с последующей автогенерацией типизированных структур облегчает жизнь разработчику. Снимает с него необходимость задумываться о промежуточном формате, о правильном порядке полей, а типизированность гарантирует выявление ошибок еще на этапе компиляции кода.
В докладе будет рассмотрено несколько подобных решений, их плюсы и минусы. Также будет рассмотрен с практической стороны наш собственный формат метаданных, используемый нами на протяжении более 5 лет.
Целевая аудитория:
Ограничений нет, но в большей степени разработчики, имеющие уже определенный опыт разработки разнородных систем или приступающие к подобной задаче.
TypeScript: особенности разработки / Александр Майоров (Tutu.ru)Ontico
TypeScript – светлое будущее ES6 уже вчера.
Почему не "Кофе"? Чай полезней.
Что не так с Flow от Facebook?
Реальная практика использования: плюсы и минусы.
Не VisualStudio единым. Особенности работы в других IDE.
Интеграция с уже существующим JS кодом.
Использование совместно с RequireJS. Подводные камни.
Использование TypeScript совместно с React.
TypeScript и Angular.
Плюшки, которых нет в ES6/7 (пока нет): [static] enum, интерфейсы, private, protected, декораторы... Что дают и зачем?
DevPoint 2016: Признаки плохого кода и как с ним бороться в PHP проектах - Па...DevPoint Kyiv
– Основные критерии оценки качества кода;
– Хардкод или Ad-hoc решение? Когда хардкод оправдан;
– Инструменты для профилактики хардкодных заболеваний;
– Бизнес VS качество кода;
-------------------------------------------------------------------------------------------------------
Сайт: http://devpoint.com.ua
FB: http://bit.ly/25Aytad
SlideShare :http://bit.ly/1SGi8d0
Статический анализ кода: Что? Как? Зачем?Andrey Karpov
Методология статического анализа год за годом зарекомендовывает себя в поисках дефектов в исходном коде программ.
Максим расскажет про:
- методологию статического анализа и какие плюсы и минусы у нее есть;
- технологии этой методологии, которые позволяют выявлять разнообразнейшие дефекты в коде;
- интересные примеры ошибок в реальных проектах, которые были найдены при помощи статического анализа;
- интеграцию инструментов статического анализа в проекты любой сложности, и почему так важно регулярное использование подобных инструментов.
«Статический анализ: гордость и предубеждения», Алексей Кузьменко, аналитик И...Mail.ru Group
Анализ кода — один из эффективных подходов к выявлению дефектов на этапе разработки программного обеспечения. Это позволяет избежать тривиальных и не очень ошибок, которые могут приводить к появлению уязвимостей. Существует ряд подходов, применяемых в анализаторах, на основании которых производится анализ, позволяющий снижать риски. Однако возникает ряд предубеждений, ведь не всегда предупреждение анализатора является реальным дефектом, тем более, что не всякий дефект является уязвимостью.
Статический и динамический полиморфизм в C++, Дмитрий ЛевановYandex
На примере некоторых архитектурных решений Крипты Дмитрий расскажет о способах реализации полиморфного поведения в программах на C++, о преимуществах и недостатках этих способов, а также о новых возможностях C++11.
В своей работе мы постоянно используем инструменты, призванные облегчить нам жизнь. Но как хорошо мы ими на самом деле владеем? И почему мы пренебрегаем их суперсилами? Например, Chrome DevTools — это не только отладчик и инспектор HTML. Но когда у нас в руках молоток, кругом мерещатся гвозди. Десятки мегабайт и процентов загрузки процессора на вкладку браузера — верный признак того, что пора учиться пользоваться микроскопом.
Роман предложит освоить что-то посложнее молотка и расскажет о том, какую реальную пользу можно получить от профилирования, как найти в огромном отчёте проблему с кодом и что лучше — написать в коде десяток console.log или async debug.
Similar to Anton Shabouta "Implementing async binary clients in pure PHP" (20)
"What does it really mean for your system to be available, or how to define w...Fwdays
We will talk about system monitoring from a few different angles. We will start by covering the basics, then discuss SLOs, how to define them, and why understanding the business well is crucial for success in this exercise.
"Microservices and multitenancy - how to serve thousands of databases in one ...Fwdays
Imagine you are designing a B2B service that will serve millions of businesses. This service will have dozens of different microservices with their own data, which can contain millions of records. How do you design such a database? Why is sharding not always the answer? What other options are there for such an architectural solution?
I'll tell you how we at Uspacy came to serve thousands of small databases instead of a few large ones, what we've encountered and what we plan to face)
"Scaling RAG Applications to serve millions of users", Kevin GoedeckeFwdays
How we managed to grow and scale a RAG application from zero to thousands of users in 7 months. Lessons from technical challenges around managing high load for LLMs, RAGs and Vector databases.
"NATO Hackathon Winner: AI-Powered Drug Search", Taras KlobaFwdays
This is a session that details how PostgreSQL's features and Azure AI Services can be effectively used to significantly enhance the search functionality in any application.
In this session, we'll share insights on how we used PostgreSQL to facilitate precise searches across multiple fields in our mobile application. The techniques include using LIKE and ILIKE operators and integrating a trigram-based search to handle potential misspellings, thereby increasing the search accuracy.
We'll also discuss how the azure_ai extension on PostgreSQL databases in Azure and Azure AI Services were utilized to create vectors from user input, a feature beneficial when users wish to find specific items based on text prompts. While our application's case study involves a drug search, the techniques and principles shared in this session can be adapted to improve search functionality in a wide range of applications. Join us to learn how PostgreSQL and Azure AI can be harnessed to enhance your application's search capability.
"Frontline Battles with DDoS: Best practices and Lessons Learned", Igor IvaniukFwdays
At this talk we will discuss DDoS protection tools and best practices, discuss network architectures and what AWS has to offer. Also, we will look into one of the largest DDoS attacks on Ukrainian infrastructure that happened in February 2022. We'll see, what techniques helped to keep the web resources available for Ukrainians and how AWS improved DDoS protection for all customers based on Ukraine experience
"Black Monday: The Story of 5.5 Hours of Downtime", Dmytro DziubenkoFwdays
We will explore the most significant incident in our product's history. We'll discuss the causes that led to the failure, how our team responded, and the measures we took to prevent future incidents. Special attention will be paid to identifying the root cause of the incident and the role of the VACUUM mechanism in PostgreSQL.
"Reaching 3_000_000 HTTP requests per second — conclusions from participation...Fwdays
In this talk, we will get acquainted with TechEmpower Web Framework Benchmarks, consider generalized (programming language-independent) approaches to optimizing a web application and its environment to achieve extreme loads, and most importantly, how some of these things can be applied in practice in your projects.
"$10 thousand per minute of downtime: architecture, queues, streaming and fin...Fwdays
Direct losses from downtime in 1 minute = $5-$10 thousand dollars. Reputation is priceless.
As part of the talk, we will consider the architectural strategies necessary for the development of highly loaded fintech solutions. We will focus on using queues and streaming to efficiently work and manage large amounts of data in real-time and to minimize latency.
We will focus special attention on the architectural patterns used in the design of the fintech system, microservices and event-driven architecture, which ensure scalability, fault tolerance, and consistency of the entire system.
"Choosing proper type of scaling", Olena SyrotaFwdays
Imagine an IoT processing system that is already quite mature and production-ready and for which client coverage is growing and scaling and performance aspects are life and death questions. The system has Redis, MongoDB, and stream processing based on ksqldb. In this talk, firstly, we will analyze scaling approaches and then select the proper ones for our system.
"What I learned through reverse engineering", Yuri ArtiukhFwdays
In recent years, I have gained most of my knowledge through reverse engineering, how I did it and what I learned during this period, I decided to share. All this concerns graphic programming, performance, best practices in the frontend.
"Impact of front-end architecture on development cost", Viktor TurskyiFwdays
I have heard many times that architecture is not important for the front-end. Also, many times I have seen how developers implement features on the front-end just following the standard rules for a framework and think that this is enough to successfully launch the project, and then the project fails. How to prevent this and what approach to choose? I have launched dozens of complex projects and during the talk we will analyze which approaches have worked for me and which have not.
"Micro frontends: Unbelievably true life story", Dmytro PavlovFwdays
A real life story about the experience of using Micro frontends in an existing Enterprise product. Problems and their solutions on the way from the integration of a separate component to an extensible No-code platform.
"Objects validation and comparison using runtime types (io-ts)", Oleksandr SuhakFwdays
A common task in modern JS is parsing, validating and then comparing JSON objects. In this talk I will quickly go through most common ways to parse/validate and compare objects we use today and then focus more on how runtime types (based on io-ts) can help make such tasks easier and quicker to implement.
"JavaScript. Standard evolution, when nobody cares", Roman SavitskyiFwdays
Should we take a look at JavaScript when everyone is writing in TypeScript? What happens to the standard? What did we get last year? What new features can we expect this and next year? And most importantly, when will Observer be standardized?
Let's try to answer all these questions and even a little more, dream about the future, and enjoy that Observer is alive (or not).
"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...Fwdays
Case study of how small team in Preply started with inheriting an existing ranking model to being able to produce a model per day. In this talk we'll cover steps to take if you find yourself in a similar situation: what kind of technology and processes can you introduce in order to achieve a great speedup in a development speed.
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil TopchiiFwdays
In my talk, I will tell about the world of GenAI services beyond GPT-wrappers and how we developed and scaled GenAI-centric applications. I'll share personal experiences about the obstacles, lessons, and strategic tools and methodologies that were key in taking GenAI applications from 0 to 1. I'll talk about the challenges we faced when launching LLM-based and image generative applications and delivering them to end users, and what conclusions and solutions were made.
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
Python engineers are introduced to the transformative potential of Large Language Models (LLMs) in the realm of advanced data analysis and the application of Semantic Kernel techniques. We will talk about how LLMs like ChatGPT can be integrated into Python environments to automate data processing, enhance predictive modeling, and unlock deeper insights from complex datasets. The session will delve into practical strategies for embedding Semantic Kernel methods within Python projects, illustrating how these advanced techniques can refine the accuracy of machine learning models by embedding domain-specific knowledge directly into the analysis process. Attendees will leave with a clear roadmap for leveraging the combined power of LLMs and Semantic Kernels, equipped with actionable knowledge to drive innovation in their data analysis projects and beyond, marking a significant leap forward in the evolution of Python engineering practices.
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
Federated learning. Algorithmic solution to the problem of privacy preserving ML. Pieces involved to support the training with NVIDIA Flare as example. How newest legislation affects federated learning.
"What is a RAG system and how to build it",Dmytro SpodaretsFwdays
Today, large language models are becoming an integral part of almost every IT solution. However, their use is often accompanied by certain limitations, such as the relevance of information or its depth and specificity. One of the ways to overcome these limitations is the method of working with LLMs - RAG (Retrieval Augmented Generation).
In an ideal world, you would write Python code and then it would work perfectly. But unfortunately, it doesn't work in this manner. In my talk, I'll cover how to efficiently debug your programs, especially in cloud environments or inside Kubernetes.
19. Пакет данных. AMQP 0-9-1
01000100000014003c00280000000b62
617369635f717565756500ce
--------------------------------
0200010000000e003c00000000000000
0000160000ce
--------------------------------
0300010000001648656c6c6f20505048
20465744617973203230313921ce
Type
Channel
Size
Body
End Byte
21. Протокол передачи данных
Набор соглашений определяющий обмен данными
между различными программами.
Бинарный протокол
Протокол, который предназначен для чтения машиной, а
не человеком.
Теория
22. Протокол передачи данных
Набор соглашений определяющий обмен данными
между различными программами.
Бинарный протокол
Протокол, который предназначен для чтения машиной, а
не человеком.
Пакет данных
Блок информации определенной структуры.
Теория
23. function packFrame(string $body): string
{
return pack(
'CCnCN',
$this->version,
$this->flags,
$this->stream,
$this->opcode,
strlen($body)
) . $body;
}
Работа с бинарными данными в PHP
24. function packFrame(string $body): string
{
return pack(
'CCnCN',
$this->version,
$this->flags,
$this->stream,
$this->opcode,
strlen($body)
) . $body;
}
Работа с бинарными данными в PHP
25. function packFrame(string $body): string
{
return pack(
'CCnCN',
$this->version,
$this->flags,
$this->stream,
$this->opcode,
strlen($body)
) . $body;
}
Работа с бинарными данными в PHP
26. function packFrame(string $body): string
{
return pack(
'CCnCN',
$this->version,
$this->flags,
$this->stream,
$this->opcode,
strlen($body)
) . $body;
}
Работа с бинарными данными в PHP
27. c - знаковый char
C - беззнаковый char
Работа с бинарными данными в PHP
28. c - знаковый char
C - беззнаковый char
s - знаковый short (ME)
S - беззнаковый short (ME)
n - беззнаковый short (BE)
v - беззнаковый short (LE)
Работа с бинарными данными в PHP
29. c - знаковый char
C - беззнаковый char
s - знаковый short (ME)
S - беззнаковый short (ME)
n - беззнаковый short (BE)
v - беззнаковый short (LE)
i - знаковый int (ME)
I - беззнаковый int (ME)
N - беззнаковый int (BE)
V - беззнаковый int (LE)
Работа с бинарными данными в PHP
30. c - знаковый char
C - беззнаковый char
s - знаковый short (ME)
S - беззнаковый short (ME)
n - беззнаковый short (BE)
v - беззнаковый short (LE)
i - знаковый int (ME)
I - беззнаковый int (ME)
N - беззнаковый int (BE)
V - беззнаковый int (LE)
l - знаковый long (ME)
L - беззнаковый long (ME)
N - беззнаковый long (BE)
V - беззнаковый long (LE)
Работа с бинарными данными в PHP
f - float (ME)
G - float (BE)
g - float (LE)
d - double (ME)
E - double (BE)
e - double (LE)
...
30+
кодов
31. function packFrame(string $body): string
{
return (string) Binary::bigEndian()
->appendUint8($this->version)
->appendUint8($this->flags)
->appendUint16($this->stream)
->appendUint8($this->opcode)
->appendUint32(strlen($body))
->append($body)
;
}
Работа с бинарными данными в PHP
https://github.com/phpinnacle/buffer
32. class Binary
{
public function append(string $value): self
{
$this->data .= $value;
$this->size += strlen($value);
return $this;
}
public function appendInt8(int $value): self
{
return $this->append(pack("c", $value));
}
}
Работа с бинарными данными в PHP
33. class Binary
{
public function read(int $n, int $offset = 0): string
{
return substr($this->data, $offset, $n);
}
public function readInt8(int $offset = 0): int
{
return unpack("c", $this->read(1, $offset))[1];
}
}
Работа с бинарными данными в PHP
34. public function parse(Binary $data): ?Frame
{
if ($data->size() < HEADER_SIZE) {
return null;
}
$type = $data->readUint8(0);
$channel = $data->readUint16(1);
$size = $data->readUint32(3);
if ($data->size() < $size + HEADER_SIZE) {
return null;
}
$body = $data->read($size);
return new Frame($type, $channel, $body);
}
Клиент. Парсер
35. public function parse(Binary $data): ?Frame
{
if ($data->size() < HEADER_SIZE) {
return null;
}
$type = $data->readUint8(0);
$channel = $data->readUint16(1);
$size = $data->readUint32(3);
if ($data->size() < $size + HEADER_SIZE) {
return null;
}
$body = $data->read($size);
return new Frame($type, $channel, $body);
}
Клиент. Парсер
36. public function parse(Binary $data): ?Frame
{
if ($data->size() < HEADER_SIZE) {
return null;
}
$type = $data->readUint8(0);
$channel = $data->readUint16(1);
$size = $data->readUint32(3);
if ($data->size() < $size + HEADER_SIZE) {
return null;
}
$body = $data->read($size);
return new Frame($type, $channel, $body);
}
Клиент. Парсер
37. public function parse(Binary $data): ?Frame
{
if ($data->size() < HEADER_SIZE) {
return null;
}
$type = $data->readUint8(0);
$channel = $data->readUint16(1);
$size = $data->readUint32(3);
if ($data->size() < $size + HEADER_SIZE) {
return null;
}
$body = $data->read($size);
return new Frame($type, $channel, $body);
}
Клиент. Парсер
38. public function parse(Binary $data): ?Frame
{
if ($data->size() < HEADER_SIZE) {
return null;
}
$type = $data->readUint8(0);
$channel = $data->readUint16(1);
$size = $data->readUint32(3);
if ($data->size() < $size + HEADER_SIZE) {
return null;
}
$body = $data->read($size);
return new Frame($type, $channel, $body);
}
Клиент. Парсер
59. PHPBench
● Тесты запускаются в отдельных процессах, что
нивелирует накладные расходы.
● Поддержка ограничений (Asserters)
60. PHPBench
● Тесты запускаются в отдельных процессах, что
нивелирует накладные расходы.
● Поддержка ограничений (Asserters)
● Различные метрики: best, avg, mean, mode, worst
61. PHPBench
● Тесты запускаются в отдельных процессах, что
нивелирует накладные расходы.
● Поддержка ограничений (Asserters)
● Различные метрики: best, avg, mean, mode, worst
● Отложенные отчеты
62. PHPBench
● Тесты запускаются в отдельных процессах, что
нивелирует накладные расходы.
● Поддержка ограничений (Asserters)
● Различные метрики: best, avg, mean, mode, worst
● Отложенные отчеты
● Форматирование отчетов: html, xml, markdown
63. PHPBench
● Тесты запускаются в отдельных процессах, что
нивелирует накладные расходы.
● Поддержка ограничений (Asserters)
● Различные метрики: best, avg, mean, mode, worst
● Отложенные отчеты
● Форматирование отчетов: html, xml, markdown
● Расширения