Skip to content

Commit

Permalink
Recommend profile.relase for Rust SDK (#1039)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhghomon authored Nov 27, 2024
1 parent 2d0f2ae commit 36477f0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/content/doc-sdk-rust/setup.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@ cargo add serde --features derive

The examples inside this SDK manual assume that all of these crates and features are present.

To maximize performance when compiling in release mode, it is recommended to use the following profile inside `Cargo.toml`, the same as [the profile used by SurrealDB](https://github.com/surrealdb/surrealdb/blob/main/Cargo.toml#L45C1-L50C18) when building each version for release.

```toml
[profile.release]
lto = true
strip = true
opt-level = 3
panic = 'abort'
codegen-units = 1
```

### Start SurrealDB

Before using `cargo run` to try out your code, make sure that the SurrealDB server is running by using the [`surreal start`](/docs/surrealdb/cli/start) command. The following command will start an in-memory server with a single root user at the default address `127.0.0.1:8000`.
Expand Down

0 comments on commit 36477f0

Please sign in to comment.