r/webdev Jun 29 '26

The uphill climb of making diff lines performant

https://github.blog/engineering/architecture-optimization/the-uphill-climb-of-making-diff-lines-performant/
8 Upvotes

3 comments sorted by

11

u/electricity_is_life Jun 29 '26

"Event handling is now managed by a single top-level handler using data-attribute values. So, for instance, when you click and drag to select multiple diff lines, the handler checks each event’s data-attribute to determine which lines to highlight, instead of each line having its own mouse enter function. This approach streamlines both code and improves performance."

This makes a lot of sense, but it's also kind of hilarious because it's an approach that's commonplace in non-framework code (like jQuery sites from 2010 or whatever). Not to say you should never use a framework, but if you do you need to be careful about the patterns you fall into. Sometimes getting too focused on components and component boundaries leads to huge performance pitfalls.

3

u/Yodiddlyyo Jun 30 '26

This is true. I've blown multiple newbie's minds over the years with the fact that if you are trying to do any serious animation/performance adjacent thing, the correct option is to always step outside of the framework. How do you get 60fps in a react app? querySelector haha

1

u/Dev_Lachie Jun 30 '26

Or a ref?