Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
tc39_study
Search
Daiki Ihara
October 09, 2019
Programming
1
680
tc39_study
Temporal
BinaryAST
Daiki Ihara
October 09, 2019
Tweet
Share
More Decks by Daiki Ihara
See All by Daiki Ihara
ArrayBufferとBinary
sasurau4
1
540
CLIから見るAngular, React, Vue
sasurau4
1
750
Metro Bundler in Web
sasurau4
0
770
reading-mtc2018-web.pdf
sasurau4
1
460
Other Decks in Programming
See All in Programming
Deno に Web 標準 API を実装する / Implementing Web Standard API to Deno
petamoriken
0
350
ONE WEDGE_Company_Information
1wedge
0
160
PHPerKaigi 2024〜10年以上動いているレガシーなバッチシステムを Kubernetes(Amazon EKS) に移行する取り組み〜
tshinowpub
1
220
phpunit/php-code-coverageって何をしてるんだ #phperkaigi
o0h
PRO
2
210
導入から5年が経って見えた Datadog APM 運用の課題
bgpat
2
540
Why 1 + 1 = 2 in Swift?
1plus4
1
240
Prepare for Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
480
設計の知識と技能で駆動するソフトウェア開発
masuda220
PRO
18
10k
Docker ハンズオン / docker-hands-on
suzukihoge
51
16k
PHPアプリケーションのスケーラビリティと 信頼性を革新する nginx+ngx_mrubyとGoの融合
pyama86
2
240
Deep Dive 大規模システムアーキテクチャ/開発組織エンジニアリング / Deep Dive Large-Scale System Architecture, Development Organization Engineering
nrslib
15
2.9k
Material 3で Material 2ぽい見た目にする
numeroanddev
2
250
Featured
See All Featured
Six Lessons from altMBA
skipperchong
19
2.9k
Embracing the Ebb and Flow
colly
78
4.1k
Designing on Purpose - Digital PM Summit 2013
jponch
109
6.4k
Fantastic passwords and where to find them - at NoRuKo
philnash
35
2.4k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
242
20k
Imperfection Machines: The Place of Print at Facebook
scottboms
257
12k
Building Flexible Design Systems
yeseniaperezcruz
317
37k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
240
1.2M
Unsuck your backbone
ammeep
660
56k
ParisWeb 2013: Learning to Love: Crash Course in Emotional UX Design
dotmariusz
101
6.6k
A Modern Web Designer's Workflow
chriscoyier
689
190k
Fashionably flexible responsive web design (full day workshop)
malarkey
397
65k
Transcript
tc39_study https://github.com/sasurau4/slides
ABOUT ME { "id": "sasurau4", "name": "Daiki Ihara", "description": "Front-end engineer at CureApp, Inc.", "techs": { "work": ["React Native", "TypeScript", "JavaScript", "MongoDB"], "subwork": ["React Native", "React", "TypeScript"], "hobby": ["React", "TypeScript", "JavaScript", "Deno"] },
"homepage": "https://sasurau4.github.io/profile/" }
What is temporal? Provides standard objects and functions for working with dates and times. This proposal is currently stage 2.
Motivation Fixing JavaScript Date java.util.Date― その悲劇と歴史
Principles All temporal APIs are non-mutating. All temporal objects are effectively immutable. All date values are based on the Proleptic Gregorian Calendar. All time-of-day values are based on a standard 24-hour clock. Leap seconds are not represented.
Specification The documentation is out of date.
Try it with polyfill node --experimental-modules --no-warnings --icu-data-dir ./node_modules/full-icu/ -r ./lib/initialise.js For more details, https://github.com/tc39/proposal-temporal/tree/main/docs
Results > const day = Temporal.Date(2019, 1, 1) undefined > day.day 1 > day.toString() '2019-01-01'
> let d1 = Temporal.DateTime(2019, 2, 1) undefined > d1.toLocaleString() '2019/2/1 0:00:00' > d1.daysInMonth 28 > let onem = Temporal.Duration(0, 1) undefined > onem.toString() 'P1M'
What is binaryAST? Startup performance degrades with larger JS payloads, even if only a fraction of the code is actually executed. Parsing time is a significant component, taking more CPU time than bytecode / initial JIT code generation. For example, on a powerful laptop, Chrome spends 10% to 15% of CPU time parsing JS while loading facebook.com. We propose a new over-the-wire format for JS that is a binary encoding of an AST. We believe this new format would allow for drastically faster parsing. Moreover, web developers are well positioned to adopt a new format as they have embraced build tooling.
Motivation from https://blog.cloudflare.com/binary-ast/
prototype of binAST from https://github.com/binast/binjs-ref As websites become more sophisticated, the amount of JavaScript source code keeps increasing. While depending upon a large JavaScript codebase won't prevent a website from working, it will cause websites to start slowly – often unacceptably slow. This is due to two bottlenecks: parsing and bytecode compiling JavaScript. Unfortunately, browsers have pretty much reached efficiency peak for both operations. We (Mozilla, Bloomberg, Facebook,
CloudFlare) are currently working on a domain-specific encoding for JavaScript, called "BinAST" (short for "JavaScript Binary AST"). The JavaScript Binary AST is designed to break the bottleneck.
Result
Details https://blog.cloudflare.com/binary-ast/
Demo Try it with Firefox nightly! https://serve-binjs.that-test.site
The End