We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Here's a small benchmark to demonstrate the issue:
processing file https://cdn.esm.sh/v63/[email protected]/es2021/lodash.js: fetching... fetch: 151ms fetched size: 73KB transforming... transform: 632ms transformed size: 151KB parsing... parse: 192ms parsed size: 3236KB printing... print: 1949ms printed size: 145KB processing file https://cdn.esm.sh/v63/[email protected]/es2021/typescript.js: fetching... fetch: 270ms fetched size: 3368KB transforming... transform: 4601ms transformed size: 5649KB parsing... parse: 2317ms parsed size: 92196KB printing... print: 1302059ms printed size: 5620KB
import { parse, print, transform } from "https://deno.land/x/swc/mod.ts"; for ( let file of [ "https://cdn.esm.sh/v63/[email protected]/es2021/lodash.js", "https://cdn.esm.sh/v63/[email protected]/es2021/typescript.js", ] ) { console.group(`\nprocessing file ${file}:`); console.group("fetching..."); console.time("fetch"); let fetched = await fetch(file).then((r) => r.text()); console.timeEnd("fetch"); printFileReport("fetched", fetched); console.groupEnd(); console.group("transforming..."); console.time("transform"); let transformed = transform(fetched, {}).code; console.timeEnd("transform"); printFileReport("transformed", transformed); console.groupEnd(); console.group("parsing..."); console.time("parse"); let program = parse(fetched, { syntax: "ecmascript" }); console.timeEnd("parse"); printFileReport("parsed", JSON.stringify(program)); console.groupEnd(); console.group("printing..."); console.time("print"); let printed = print(program, {}).code; console.timeEnd("print"); printFileReport("printed", printed); console.groupEnd(); console.groupEnd(); } function printFileReport(name: string, file: string) { console.log(`${name} size: ${file.length / 1e3 | 0}KB`); }
Note that the print time for typescript.js is over 20 minutes.
print
typescript.js
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Here's a small benchmark to demonstrate the issue:
Benchmark Source
Note that the
print
time fortypescript.js
is over 20 minutes.The text was updated successfully, but these errors were encountered: