Opens profile photo
Follow
Click to Follow rniwa_dev
rniwa.dev
@rniwa_dev
WebKitten since 2009. 超愛貓❤️の喺美國嘅日本人 Email: rniwa at protonmail
S.F. Bay Arearniwa.comJoined August 2020

rniwa.dev’s Tweets

Pinned Tweet
It's a bit of understatement to say project cares about performance or efficiency of the software. We're quite obsessed with it, and we throw a lot of engineering resources at it, not to regress, and to improve upon.
8
177
Show this thread
Declarative shadow DOM and form associated custom elements are enabled in STP162!
Quote Tweet
Safari Technology Preview 162 is now available with updates to Web Inspector, CSS (including Nesting, relative color syntax, and margin-trim), Web API (including declarative Shadow DOM and form-associated custom elements), Accessibility, and more. webkit.org/blog/13703/rel
Safari Technology Preview app icon on macOS Ventura featuring a red and white compass needle over a purple compass face with white radial marks.
34
One of more surprising facts I learned over working on a large C++ projects (WebKit) is that an optimizing compiler can turn a nullptr deref in debug / -O0 into a type confusion or use after free bug in release / -O3 because nullptr dereference invokes an undefined behavior. 😬
4
My goodness, I spent my entire afternoon + night debugging a stupid bug in webkitpy. It's 3:16am and I've finally found a fix. 😬
9
Live range selection, declarative shadow DOM, and form-associated custom elements. We're starting 2023 strong.
8
58
Creating an interface just so that you can dependency inject / mock for unit testing purposes will result in proliferation of useless abstractions. Adding another layer of abstraction is a solution to every problem in CS until layers of abstractions become an issue on its own.
7
I'd love to hear stories of the last time someone had to distinguish Latin a, Greek a, and Cyrillic a in a single sentence and using wrong form would have resulted in a failed dictionary lookup because you know... they all look & mean so different.
Show this thread
If you don't think Unicode's Han unification is anything to do with racism / cultural appropriation after learning the existence of so many code points for different variants of "a"'s and how arbitrary Han unification is, you might be a part of the problem. #unicode
1
2
Show this thread
Yes would mean <template id=t><my-element><template shadowrootmode="open">...</template></my-element></template> will have t.firstChild.shadowRoot defined; No would mean that t.firstChild.firstChild is a template element with shadowrootmode content attribute set to "open"
1
Show this thread
That is not to say you should ignore perf while you're building your app or website. You need to architect it right in order to have a responsive website or web app. But that's a different matter from prematurely concluding that one API is faster than another in abstract.
2
Show this thread
It's very easy to measure API's perf in its isolation and falsely conclude that X is faster than Y. The usage pattern and context absolutely matters. Nobody calls querySelector thousands of times with the exact same argument without mutating DOM. Build your app then measure.
1
5
Show this thread
github.com/WebKit/WebKit/ This was an interesting experiment. The streaming version of declarative shadow DOM is ~7% faster than the non-streaming version. With some tricks, we minimized the HTML parser changes, and now we have a rough consensus to go with the this approach. 🚀
1
57
But what happens when we can't identify the culprit or the regression was introduced by a necessary feature work? We look for other optimizations for the same benchmark to compensate. This way, overall user experience doesn't regrade over time.
1
14
Show this thread
This tiresome, thankless work that happens behind the scene is WebKit's secret for being the fastest browser engine. Your phone ran JS a few milliseconds faster today because someone spent two months looking for the cause of ~0.5% regression.
1
30
Show this thread
To catch a regression of a very small magnitude, we use perf A/B testing; i.e. running the same benchmark for 10-20 times at two different revisions of WebKit. Some regression analysis can take weeks or even months even with various automatons.
1
18
Show this thread
The hardest of which is "performance defense" whereby we monitor WebKit's performance over time and catch any regressions. Often times, they're are introduced by changes to other OS components. It's remarkable that we manage to catch regressions in the order of 0.3~1% every year.
1
23
Show this thread
Software engineering is hard in so far as figuring out what problem(s) to solve is tricky. Writing code is the easy part.
1
5