Forwarded from 💞Gay Mems🔥 | Гей мемы 💪
Please open Telegram to view this post
VIEW IN TELEGRAM
😁14🤮12🎉6💩3
#prog #rust #java #article
How We Migrated Our Static Analyzer From Java To Rust
Меня, правда, смущает, что правила анализа почему-то написаны на JavaScript.
<...>
We observed that the migration tripled our performance and resulted in a tenfold reduction in memory usage, <...>
To our surprise, we gained a firm grasp of the language and a clear idea of how our codebase would be mapped onto Rust within 10 days. <...> Within a month, the entire code analysis infrastructure was migrated from Java to Rust, and all customers were running on the new Rust analyzer.
<...>
Removing our dependency on the JVM and speeding up the analysis enabled us to embed the analyzer directly into the IDE. The very same lightweight and fast analyzer that runs in your CI/CD pipelines simultaneously reports coding errors and suggests fixes in your IDE in real time, <...>
How We Migrated Our Static Analyzer From Java To Rust
Меня, правда, смущает, что правила анализа почему-то написаны на JavaScript.
<...>
We observed that the migration tripled our performance and resulted in a tenfold reduction in memory usage, <...>
To our surprise, we gained a firm grasp of the language and a clear idea of how our codebase would be mapped onto Rust within 10 days. <...> Within a month, the entire code analysis infrastructure was migrated from Java to Rust, and all customers were running on the new Rust analyzer.
<...>
Removing our dependency on the JVM and speeding up the analysis enabled us to embed the analyzer directly into the IDE. The very same lightweight and fast analyzer that runs in your CI/CD pipelines simultaneously reports coding errors and suggests fixes in your IDE in real time, <...>
❤1👍1🤔1🌚1🤨1
#prog #rust #article
Send & Mutex
I saw a question on Reddit, that asks: “why T needs to be Send in order to Mutex<T> to be Sync?”. I think that’s a great question, and in here I’ll try my best to shine some light on that.
Автор излагает объяснение, опираясь на неканоничное определение
allows an object to be used by two threads A and B at different times.
, в противовес
allows an object to to be used by two threads A and B at the same time.
Это позволяет ответить на вопрос в начале более простым образом.
Send & Mutex
I saw a question on Reddit, that asks: “why T needs to be Send in order to Mutex<T> to be Sync?”. I think that’s a great question, and in here I’ll try my best to shine some light on that.
Автор излагает объяснение, опираясь на неканоничное определение
Send
:allows an object to be used by two threads A and B at different times.
, в противовес
Sync
:allows an object to to be used by two threads A and B at the same time.
Это позволяет ответить на вопрос в начале более простым образом.
👍2❤1
#prog #article
When allocating unused memory boosts performance by 2x
During performance testing, I stumbled upon a weird performance effect. The throughput of a function increased by 2x when I added a dataset but didn't use it anywhere. Such fluctuations are not unheard of and could be caused by a myriad of things. But this time the code was so unrelated that I had to investigate further, especially since the effect was consistent and not a fluke.
Спойлер:гистерезис-подобное поведение аллокатора glibc касательно возврата аллоцированной памяти операционной системе.
When allocating unused memory boosts performance by 2x
During performance testing, I stumbled upon a weird performance effect. The throughput of a function increased by 2x when I added a dataset but didn't use it anywhere. Such fluctuations are not unheard of and could be caused by a myriad of things. But this time the code was so unrelated that I had to investigate further, especially since the effect was consistent and not a fluke.
Спойлер:
😱4🔥2🤔1
💞Gay Mems🔥 | Гей мемы 💪
Вы не поверите, но в России потребовали заблокировать Duolingo. Активисты нашли в приложении фразы, которые сочли пропагандой «нетрадиционных отношений». Например: Бен и Питер любят друг друга. Они геи Клара встретила свою жену Марию в гей-баре Они думают…
Парни ПЛЮС
«Duolingo» удаляет ЛГБТ-контент по требованию Роскомнадзора - Парни ПЛЮС
Компания «Duolingo» официально сообщила Роскомнадзору об удалении из своего сервиса контента, который пользователи могут принять за...
🤡14👍9😁4🎉2
#prog #rust #article
Taming Floating-Point Sums
Статья о различных способах суммировать числа с плавающей точкой: способы быстрее прямолинейного и способы точнее прямолинейного.
Осторожно, бенчмарки проводились на данных, которые умещаются в кеш процессора
Taming Floating-Point Sums
Статья о различных способах суммировать числа с плавающей точкой: способы быстрее прямолинейного и способы точнее прямолинейного.
Осторожно, бенчмарки проводились на данных, которые умещаются в кеш процессора
👍4
#prog #algo #article
Bitwise Binary Search: Elegant and Fast
Статья о вариантах двоичного поиска (конкретнее, поиска нижней границы места для вставки), которые вычисляют по одному биту результата за итерацию. Подобные алгоритмы можно записать в branchless виде, что позволяет сильно их ускорить по сравнению с "обычным" вариантом.
Предупреждение: автор делал бенчмарки на Apple M1 и оптимизировал под него, так что ваши результаты наверняка будут отличаться.
Bitwise Binary Search: Elegant and Fast
Статья о вариантах двоичного поиска (конкретнее, поиска нижней границы места для вставки), которые вычисляют по одному биту результата за итерацию. Подобные алгоритмы можно записать в branchless виде, что позволяет сильно их ускорить по сравнению с "обычным" вариантом.
Предупреждение: автор делал бенчмарки на Apple M1 и оптимизировал под него, так что ваши результаты наверняка будут отличаться.
🔥6👍3❤2