TGViewer
Библиотека Java разработчика Библиотека Java разработчика @bookjava · 10K subscribers
Post #2675 1.86K
Оптимизация методов equals() с помощью метода Pattern Matching

0:00 Intro: designing equals() methods
1:13 Generating equals() and hashCode() methods
1:56 What could go wrong with a bad hashCode() method
4:31 Taking a look at the generated equals() methods
7:11 Checking the record and pattern matching implementations
9:33 What is predictive branching, what is the cost of a failing prediction?
12:41 Evaluating the cost of two failing predictions.
14:53 Evaluating the performance of equals() methods on simple data sets
16:07 First data set: all the objects are the same instance
16:46 Second data set: different instances carrying the same state
18:43 Third data set: different objects of the same type
20:41 Fourth data set: objects of different types
22:00 First conclusions on what patterns are the best
22:39 Adding glitches to the data sets
24:41 Results for first data set (same instances) with glitches
25:20 Results for second data set (equal instances) with glitches
26:07 Results for third data set (different instances) with glitches
28:30 Results for fourth data set (different types) with glitches
30:05 What conclusions can you draw from all these benches?
32:33 That's it for today, talk to you soon!

источник

👉@BookJava
  • 👍 1
More from @bookjava
  1. Oct 10, 2026🚀 Подборка полезных IT каналов в Max Системное администрирование, DevOps 📌 https://max.r…
  2. Oct 8, 2026📌 Обход коллекций в Java: делаем правильно! Часто вижу, как разработчики по привычке испо…
  3. Oct 7, 2026📌 Stream API: забудьте про peek() Метод peek() в Java Stream API выглядит удобным для отл…
  4. Oct 5, 2026🧠 Dependency Inversion Principle (D в SOLID) Зависимости должны идти от высокоуровневой п…
  5. Sep 30, 2026Три похожих слова в Java — final, finally, finalize — но смысл у них совершенно разный. Ра…
  6. Sep 27, 2026🧠 Ленивая инициализация через Supplier — элегантная альтернатива double-checked locking К…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →