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
780
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
tc39_study
Temporal
BinaryAST
Daiki Ihara
October 09, 2019
More Decks by Daiki Ihara
See All by Daiki Ihara
ArrayBufferとBinary
sasurau4
1
650
CLIから見るAngular, React, Vue
sasurau4
1
990
Metro Bundler in Web
sasurau4
0
1k
reading-mtc2018-web.pdf
sasurau4
1
570
Other Decks in Programming
See All in Programming
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.3k
『コードを書く以外の』エンジニアリング〜課金基盤移行プロジェクト推進のためのTips4選
yuriko1211
0
400
【やさしく解説 設計編 #0】DDDのコード、読めるのに分からない人へ
panda728
PRO
2
260
Hatena Engineer Seminar #37「言語モデルの活用に関する研究」
slashnephy
0
510
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
490
act2-costs.pdf
sumedhbala
0
110
Vite+ Unified Toolchain for the Web
naokihaba
0
740
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
1
170
Skillsは効率化、Agentsは"自分の拡張"——Builder時代のエージェント編成(CC Night 2026)
wemra
1
210
AIキャラアプリkaiwaの低遅延音声通話基盤をどう作ったか - AWS Gravitonで支える低遅延・低コストAI Agent基盤
mogamit
0
170
1年で人数1.5倍、PR数5.5倍増。 品質とアウトカムはどうなったか、 何が効いたか
ike002jp
0
120
Performance Engineering for Everyone
elenatanasoiu
0
270
Featured
See All Featured
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
750
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.1k
GitHub's CSS Performance
jonrohan
1033
470k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
550
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
260
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Raft: Consensus for Rubyists
vanstee
141
7.6k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.6k
Tell your own story through comics
letsgokoyo
1
990
Tips & Tricks on How to Get Your First Job In Tech
honzajavorek
1
560
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