# Performance

## Performance

DCli is intended to start as fast as Bash and run faster than Bash.

When you first run your new DCli script, DCli has some house keeping to do including running a `pub get` which retrieves and caches any of your scripts dependencies.

The result is that DCli has similar start times to Bash and when running larger scripts is faster than Bash.

If you absolutely need to make your script perform to the max, you will want to use DCli to compile your script.

### Compiling to Native

DCli also allows you to compile your script and any dependencies to a native executable.

```
dcli compile <scriptname.dart>
```

DCli will automatically mark your new exec as executable using `chmod +x`.

Run you natively compiled script to see just how much faster it is now:

{% tabs %}
{% tab title="Linux" %}

```
./scriptname
```

{% endtab %}

{% tab title="OSX" %}

```
./scriptname
```

{% endtab %}

{% tab title="Windows" %}

```
scriptname.exe
```

{% endtab %}
{% endtabs %}

As this the script fully compiled, changes to your local script file will NOT affect it (until you recompile) and when the exe runs it will never need to do a pub get as all dependencies are compiled into the native executable.

Check out the the --install option to install the script into your path.

You can now copy the exe to another machine (that is binary compatible) and run the exe without having to install Dart, DCli or any other dependency.

{% hint style="info" %}
Once compiled your script will run on any binary compatible machine WITHOUT dart or dcli.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://dcli.onepub.dev/performance.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
