forked from ampproject/worker-dom
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Benchmark + optimize (ampproject#1096)
* Create benchmarks for createElement * Create IS_SERVER for optimizing path. * Optimize the paths and measure results along the way * rm comments * unecessary type * whoops extra file * Some more early exits, only supply value when true. * remove minification for server-lib * be smarter (attach to process.env for var replacment) * undo unrelated changes * add comment for context on lazy css
- Loading branch information
Showing
10 changed files
with
85 additions
and
122 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import Benchmark from 'benchmark'; | ||
|
||
import { createDocument } from './dist/server-lib.mjs'; | ||
const doc = createDocument(); | ||
|
||
var suite = new Benchmark.Suite(); | ||
suite | ||
.add('createElement', function () { | ||
doc.createElement('test-elem'); | ||
}) | ||
.on('complete', function () { | ||
const results = Array.from(this); | ||
console.log(results.join('\n')); | ||
}) | ||
.run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.