Dart compiles to JavaScript, sometimes generating code that's faster than hand-written JavaScript. Watch Dart co-founder Kasper Lund explain how the dart2js compiler performs local and global optimizations to emit fast and semantically correct JavaScript code. With tree shaking, type inference, and minification, Dart can help you optimize your web app.
Dart for the Modern Web Developer
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-08-06 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-08-06 UTC."],[[["Dart compiles to JavaScript, potentially outperforming hand-written JavaScript in speed."],["The dart2js compiler utilizes local and global optimizations for efficient and accurate JavaScript code generation."],["Dart employs tree shaking, type inference, and minification to help developers optimize web applications."]]],["Dart's dart2js compiler optimizes code for the web by performing local and global optimizations, often surpassing hand-written JavaScript in speed. It uses techniques like tree shaking, removing unused code, type inference to deduce data types, and minification to reduce code size. These optimization methods ensure that the JavaScript code generated from Dart is both semantically accurate and highly performant, ultimately improving web app performance.\n"]]