-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Benchmark + optimize #1096
Benchmark + optimize #1096
Conversation
src/main-thread/main-thread.d.ts
Outdated
@@ -62,3 +62,4 @@ type RenderableElement = (HTMLElement | SVGElement | Text | Comment) & { | |||
|
|||
declare const WORKER_DOM_DEBUG: boolean; | |||
declare const IS_AMP: boolean; | |||
declare const IS_SERVER: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚲 🏚️ :
declare const IS_SERVER: boolean; | |
declare const DISABLE_TRANSFERS: boolean; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats true for now. But the higher level notion is that it is meant for usage on server instead of client
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT of the new thing I did, which is kind of nice IMO. Attached to process.env.SERVER
.
Edit: actually..i'm not sure if this works in client at all. testing now
Edit Edit: it works when I always provide the subsitutions
}, | ||
preventAssignment: true, | ||
}), | ||
replacePlugin({ debug: true }), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the debug: true
supposed to be included here? Maybe based on a flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is configuration for the output file: dist/debug/main.mjs
(scroll up a few lines to see that).
For this binary we want all of the debug code. Very similar to amphtml's mode
summary
Creates a super basic
benchmark.mjs
file for measuringcreateElement
performance.Then makes 4 small changes that each remove memory leaks and/or improve ctor performance
initial performance
opt: skip HTMLElement ctor store
opt: getter for CSSStyleDeclaration (lazy instantiation)
opt: class field loose transform
opt: remove minification step (note: I don't know why this has faster output)
cc @rcebulko