mirror of
https://github.com/mdgriffith/elm-optimize-level-2.git
synced 2024-11-29 12:46:32 +03:00
add v8 analysis transormations
This commit is contained in:
parent
54eb331b2e
commit
98028ed16c
@ -19,14 +19,16 @@ const defaultOptions: Transforms = {
|
||||
replaceVDomNode: false,
|
||||
variantShapes: true,
|
||||
inlineNumberToString: false,
|
||||
inlineEquality: false,
|
||||
inlineFunctions: false,
|
||||
inlineEquality: true,
|
||||
inlineFunctions: true,
|
||||
listLiterals: false,
|
||||
passUnwrappedFunctions: false,
|
||||
passUnwrappedFunctions: true,
|
||||
arrowFns: false,
|
||||
shorthandObjectLiterals: false,
|
||||
objectUpdate: ObjectUpdate.InlineSpread,
|
||||
objectUpdate: false,
|
||||
unusedValues: false,
|
||||
replaceListFunctions: true,
|
||||
v8Analysis: false
|
||||
};
|
||||
|
||||
const options = {
|
||||
@ -67,11 +69,11 @@ async function go() {
|
||||
// dir: 'testcases/elm-css',
|
||||
// elmFile: 'Main.elm',
|
||||
// },
|
||||
// {
|
||||
// name: 'Html',
|
||||
// dir: 'testcases/html',
|
||||
// elmFile: 'Main.elm',
|
||||
// },
|
||||
{
|
||||
name: 'Html',
|
||||
dir: 'testcases/html',
|
||||
elmFile: 'Main.elm',
|
||||
},
|
||||
// {
|
||||
// name: 'Elm UI',
|
||||
// dir: 'testcases/elm-ui',
|
||||
@ -93,11 +95,11 @@ async function go() {
|
||||
// elmFile: 'Run.elm',
|
||||
// },
|
||||
// // // This one takes forever
|
||||
{
|
||||
name: 'elm-obj-file',
|
||||
dir: 'testcases/elm-obj-file',
|
||||
elmFile: 'Run.elm',
|
||||
},
|
||||
// {
|
||||
// name: 'elm-obj-file',
|
||||
// dir: 'testcases/elm-obj-file',
|
||||
// elmFile: 'Run.elm',
|
||||
// },
|
||||
]);
|
||||
const result = await report;
|
||||
|
||||
|
@ -23,6 +23,7 @@ import { createPassUnwrappedFunctionsTransformer } from './transforms/passUnwrap
|
||||
import { replaceVDomNode } from './transforms/adjustVirtualDom';
|
||||
import { inlineNumberToString } from './transforms/inlineNumberToString';
|
||||
import { replaceListFunctions } from './transforms/replaceListFunctions';
|
||||
import { reportFunctionStatusInBenchmarks, v8Debug } from './transforms/analyze';
|
||||
|
||||
export type Options = {
|
||||
compile: boolean;
|
||||
@ -78,6 +79,9 @@ export const transform = async (
|
||||
|
||||
let inlineCtx: InlineContext | undefined;
|
||||
const transformations: any[] = removeDisabled([
|
||||
[transforms.replaceListFunctions, replaceListFunctions],
|
||||
|
||||
[transforms.v8Analysis, v8Debug],
|
||||
[transforms.variantShapes, normalizeVariantShapes],
|
||||
[transforms.inlineFunctions, createFunctionInlineTransformer(verbose)],
|
||||
[transforms.inlineEquality, inlineEquality()],
|
||||
@ -103,7 +107,7 @@ export const transform = async (
|
||||
[transforms.arrowFns, convertFunctionExpressionsToArrowFuncs],
|
||||
[transforms.shorthandObjectLiterals, convertToObjectShorthandLiterals],
|
||||
[transforms.unusedValues, createRemoveUnusedLocalsTransform()],
|
||||
[transforms.replaceListFunctions, replaceListFunctions],
|
||||
[transforms.v8Analysis, reportFunctionStatusInBenchmarks],
|
||||
]);
|
||||
|
||||
const {
|
||||
|
@ -35,6 +35,7 @@ export type Transforms = {
|
||||
objectUpdate: ObjectUpdate | false;
|
||||
unusedValues: boolean;
|
||||
replaceListFunctions: boolean;
|
||||
v8Analysis: boolean;
|
||||
};
|
||||
|
||||
export enum InlineLists {
|
||||
@ -76,4 +77,5 @@ export const toolDefaults: Transforms = {
|
||||
objectUpdate: false,
|
||||
unusedValues: false,
|
||||
replaceListFunctions: false,
|
||||
v8Analysis: false
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user