4 ms·
What would be an example of a non hacky way of hinting to the browser which properties are likely to change?
by eli 12y ago
What would be an example of a non hacky way of hinting to the browser which properties are likely to change?
- untog 12y agoIn my dream scenario there's no need to do hinting at all. Most other platforms don't require it. But I am living and working in the real world, which has a significant legacy of web technology.
- eli 12y agoThe web doesn't require it either--we've made it this far, after all. I bet every platform has developers who wish they had simple tools to boost performance.
- resu_nimda 12y agoThe web doesn't require it either--we've made it this far, after all. That is a perfect encapsulation of the "OK-ness" he's talking about. Yeah, it works just fine. Yeah, the web doesn't "require" a smart graphics processing engine, it probably didn't "require" videos or the canvas or CSS transitions at all. But "really good" modern platforms have these capabilities, and IMO there's nothing wrong with wanting or trying to push the web to be as good a platform as possible, and it is frustrating (but understandable) that there is so much legacy baggage "holding it back."
- TheLoneWolfling 12y agoAn important point, however. One should not assume that all platforms have these capabilities!
- eli 12y agoI get that sentiment in general, but what does it have to do with a new hinting feature? Would hinting look different without legacy baggage? Would it not be needed? I don't see how it's possible to create an ideal browser that is fast at everything and also memory efficient. And there are always legitimate reasons to want to juice the most performance out of your pages.
- claudius 12y agoI can’t think of another platform (in the sense of programming environment) which is being optimised to be read milliseconds before execution from a networking socket, with more code being loaded on-the-fly from remote servers. In C++, you have all your code at compile-time and even in Python/Ruby/Perl/Bash etc., it would be highly unusual for the shell to anticipate the equivalent of wget -O foo ${URL} && . foo. Given the constraints, having to add some hints doesn’t seem all that bad to me.
- pcwalton 12y agoiOS definitely has such a thing via Core Animation layers.
- nkozyra 12y agoSaddling every element in the DOM with a data-will-change="TRUE" or data-might-change="POSSIBLY" and utilizing a heavy jQuery plugin to inject browser-specific CSS rules.
- gibbitz 12y agoHow about "look ahead"? If there are transition or keyframe properties related to variations of the selector, why not do this automatically? I understand the overhead, but from the standpoint of hackiness this would be the technology working as expected.
- eli 12y agoHow could a browser "automatically" know what changes I'm going to make to the DOM in a dynamic web app? Having the browser try to guess what transitions will be needed in the near future based on "related" selectors sounds way more hacky than a straightforward property that declares it. As the article notes, for all but trivial examples, these are likely to be added via Javascript. The static CSS file with ":hover" and ":active" was jsut an example.