Skip to content

Point tango to git rev to fix paired benchmarks - #645

Merged
tomcur merged 1 commit into
linebender:mainfrom
tomcur:push-kwztvornvskl
Jun 22, 2026
Merged

Point tango to git rev to fix paired benchmarks#645
tomcur merged 1 commit into
linebender:mainfrom
tomcur:push-kwztvornvskl

Conversation

@tomcur

@tomcur tomcur commented Jun 21, 2026

Copy link
Copy Markdown
Member

tango recently switched to running the paired comparison benchmarks in separate processes (bazhenov/tango#78). This is fortunate, as it turns out to also fix an issue I encountered in #634 (comment).

On current main, if I run cargo export target/benchmarks -- bench --bench=main followed by cargo bench -q --bench=main -- compare target/benchmarks/main -p -t 4., I get the following!

Default Style - arabic 20 characters               [   8.9 us ...   8.9 us ]      +0.35%
Default Style - latin 20 characters                [   4.3 us ...   4.1 us ]      -3.50%*
Default Style - japanese 20 characters             [   8.2 us ...   8.1 us ]      -0.44%
Default Style - arabic 1 paragraph                 [  48.5 us ...  48.1 us ]      -0.66%
Default Style - latin 1 paragraph                  [  17.2 us ...  16.1 us ]      -6.52%*
Default Style - japanese 1 paragraph               [  71.3 us ...  69.6 us ]      -2.50%*
Default Style - arabic 4 paragraph                 [ 214.5 us ... 212.7 us ]      -0.86%
Default Style - latin 4 paragraph                  [  66.0 us ...  62.0 us ]      -5.96%*
Default Style - japanese 4 paragraph               [ 100.7 us ...  98.5 us ]      -2.18%*
Styled - arabic 20 characters                      [   9.9 us ...   9.9 us ]      +0.41%
Styled - latin 20 characters                       [   5.3 us ...   5.3 us ]      -1.01%*
Styled - japanese 20 characters                    [   8.8 us ...   8.7 us ]      -0.60%*
Styled - arabic 1 paragraph                        [  51.3 us ...  51.0 us ]      -0.60%
Styled - latin 1 paragraph                         [  21.4 us ...  20.9 us ]      -2.52%*
Styled - japanese 1 paragraph                      [  78.7 us ...  77.5 us ]      -1.52%*
Styled - arabic 4 paragraph                        [ 232.7 us ... 232.1 us ]      -0.27%
Styled - latin 4 paragraph                         [  83.2 us ...  80.6 us ]      -3.18%*
Styled - japanese 4 paragraph                      [ 109.7 us ... 108.3 us ]      -1.34%*

I.e., there are quite a few significant "improvements." This is without any code changes and isn't measurement noise. A possible explanation is there's a difference between the in-process code and the dlopen'd code performance that shows up at least on my machine. I don't think it's a P- vs E-core thing or something like that, as when I pin the threads to equally-powerful cores (same features, same max freq), the results stay like this.

Measured using the git revision of tango, the results are more reasonable.

$ cargo export target/benchmarks -- bench --bench=main
$ cargo bench -q --bench=main -- compare ../target/benchmarks/main -t 4.
Default Style - arabic 20 characters               [   8.7 us ...   8.7 us ]      -0.04%
Default Style - latin 20 characters                [   4.1 us ...   4.1 us ]      +1.76%*
Default Style - japanese 20 characters             [   7.9 us ...   8.0 us ]      +0.24%
Default Style - arabic 1 paragraph                 [  46.7 us ...  46.9 us ]      +0.47%
Default Style - latin 1 paragraph                  [  16.0 us ...  16.0 us ]      -0.08%
Default Style - japanese 1 paragraph               [  68.4 us ...  68.3 us ]      -0.10%
Default Style - arabic 4 paragraph                 [ 196.5 us ... 196.9 us ]      +0.23%
Default Style - latin 4 paragraph                  [  61.1 us ...  61.1 us ]      +0.10%
Default Style - japanese 4 paragraph               [  96.7 us ...  96.4 us ]      -0.32%
Styled - arabic 20 characters                      [   9.6 us ...   9.6 us ]      +0.19%
Styled - latin 20 characters                       [   5.2 us ...   5.3 us ]      +0.32%
Styled - japanese 20 characters                    [   8.5 us ...   8.4 us ]      -0.10%
Styled - arabic 1 paragraph                        [  49.1 us ...  49.0 us ]      -0.08%
Styled - latin 1 paragraph                         [  20.4 us ...  20.4 us ]      -0.05%
Styled - japanese 1 paragraph                      [  74.2 us ...  74.4 us ]      +0.22%
Styled - arabic 4 paragraph                        [ 216.0 us ... 215.8 us ]      -0.10%
Styled - latin 4 paragraph                         [  79.1 us ...  79.2 us ]      +0.19%
Styled - japanese 4 paragraph                      [ 105.2 us ... 105.4 us ]      +0.17%

`tango` recently switched to running the paired comparison benchmarks in
separate processes (bazhenov/tango#78). This is
fortunate, as it turns out to also fix an issue I encountered.

On current `main`, if I run `cargo export target/benchmarks -- bench --bench=main`
followed by `cargo bench -q --bench=main -- compare target/benchmarks/main -p -t 4.`,
I get the following!

```
Default Style - arabic 20 characters               [   8.9 us ...   8.9 us ]      +0.35%
Default Style - latin 20 characters                [   4.3 us ...   4.1 us ]      -3.50%*
Default Style - japanese 20 characters             [   8.2 us ...   8.1 us ]      -0.44%
Default Style - arabic 1 paragraph                 [  48.5 us ...  48.1 us ]      -0.66%
Default Style - latin 1 paragraph                  [  17.2 us ...  16.1 us ]      -6.52%*
Default Style - japanese 1 paragraph               [  71.3 us ...  69.6 us ]      -2.50%*
Default Style - arabic 4 paragraph                 [ 214.5 us ... 212.7 us ]      -0.86%
Default Style - latin 4 paragraph                  [  66.0 us ...  62.0 us ]      -5.96%*
Default Style - japanese 4 paragraph               [ 100.7 us ...  98.5 us ]      -2.18%*
Styled - arabic 20 characters                      [   9.9 us ...   9.9 us ]      +0.41%
Styled - latin 20 characters                       [   5.3 us ...   5.3 us ]      -1.01%*
Styled - japanese 20 characters                    [   8.8 us ...   8.7 us ]      -0.60%*
Styled - arabic 1 paragraph                        [  51.3 us ...  51.0 us ]      -0.60%
Styled - latin 1 paragraph                         [  21.4 us ...  20.9 us ]      -2.52%*
Styled - japanese 1 paragraph                      [  78.7 us ...  77.5 us ]      -1.52%*
Styled - arabic 4 paragraph                        [ 232.7 us ... 232.1 us ]      -0.27%
Styled - latin 4 paragraph                         [  83.2 us ...  80.6 us ]      -3.18%*
Styled - japanese 4 paragraph                      [ 109.7 us ... 108.3 us ]      -1.34%*
```

This is without any code changes and isn't measurement noise. A possible
explanation is there's a difference between the in-process code and the
`dlopen`'d code performance that shows up at least on my machine. I
don't think it's a P- vs E-core thing or something like that, as when I
pin the threads to equally-powerful cores (same features, same max
freq), the results stay like this.

Measured with this PR, the results are more reasonable.

```
$ cargo export target/benchmarks -- bench --bench=main
$ cargo bench -q --bench=main -- compare ../target/benchmarks/main -t 4.
Default Style - arabic 20 characters               [   8.7 us ...   8.7 us ]      -0.04%
Default Style - latin 20 characters                [   4.1 us ...   4.1 us ]      +1.76%*
Default Style - japanese 20 characters             [   7.9 us ...   8.0 us ]      +0.24%
Default Style - arabic 1 paragraph                 [  46.7 us ...  46.9 us ]      +0.47%
Default Style - latin 1 paragraph                  [  16.0 us ...  16.0 us ]      -0.08%
Default Style - japanese 1 paragraph               [  68.4 us ...  68.3 us ]      -0.10%
Default Style - arabic 4 paragraph                 [ 196.5 us ... 196.9 us ]      +0.23%
Default Style - latin 4 paragraph                  [  61.1 us ...  61.1 us ]      +0.10%
Default Style - japanese 4 paragraph               [  96.7 us ...  96.4 us ]      -0.32%
Styled - arabic 20 characters                      [   9.6 us ...   9.6 us ]      +0.19%
Styled - latin 20 characters                       [   5.2 us ...   5.3 us ]      +0.32%
Styled - japanese 20 characters                    [   8.5 us ...   8.4 us ]      -0.10%
Styled - arabic 1 paragraph                        [  49.1 us ...  49.0 us ]      -0.08%
Styled - latin 1 paragraph                         [  20.4 us ...  20.4 us ]      -0.05%
Styled - japanese 1 paragraph                      [  74.2 us ...  74.4 us ]      +0.22%
Styled - arabic 4 paragraph                        [ 216.0 us ... 215.8 us ]      -0.10%
Styled - latin 4 paragraph                         [  79.1 us ...  79.2 us ]      +0.19%
Styled - japanese 4 paragraph                      [ 105.2 us ... 105.4 us ]      +0.17%
```
Comment thread parley_bench/README.md

# Compare changes with baseline
cargo bench -q --bench=main -- compare target/benchmarks/main -p
cargo bench -q --bench=main -- compare ../target/benchmarks/main

@tomcur tomcur Jun 21, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The target is now relative to current_dir, see bazhenov/tango#73. The -p flag to bench in separate threads is dropped as I believe tango now unconditionally spawns two processes.

@DJMcNab DJMcNab Jun 21, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean we need to have cding into this directory as a step?

(Edit: maybe not? Seems like this is something which cargo sets; this seems a bit jank...)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also seems odd to me.

@DJMcNab DJMcNab left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes me want to try running this in CI...

Comment thread parley_bench/README.md
$ cargo install cargo-export
```

NOTE: Windows users may require additional setup. See Tango docs for more information.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this Tango update maintain this caveat?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, https://github.com/bazhenov/tango/tree/1d69f0728b707597409be0cc199e7a0173a666dd#getting-started: Windows requires rustflags = ["-Zexport-executable-symbols"].

@bazhenov bazhenov Jun 23, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey! 👋 Tango maintainer here. After merging bazhenov/tango#78 -Zexport-executable-symbols is actually not needed. Today I've merged the code that checks that everything works without any custom configuration on a stable toolchain on all 3 platforms (see bazhenov/tango#80).

So you can remove it as well as nightly toolchain on Windows and build.rs modifications on Linux/macOS. Cheers!

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you for notifying us and for maintaining tango!

#646 removes the old custom config from Parley.

Comment thread parley_bench/README.md

# Compare changes with baseline
cargo bench -q --bench=main -- compare target/benchmarks/main -p
cargo bench -q --bench=main -- compare ../target/benchmarks/main

@DJMcNab DJMcNab Jun 21, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this mean we need to have cding into this directory as a step?

(Edit: maybe not? Seems like this is something which cargo sets; this seems a bit jank...)

@tomcur
tomcur added this pull request to the merge queue Jun 22, 2026
Merged via the queue into linebender:main with commit aa687b4 Jun 22, 2026
24 checks passed
@tomcur
tomcur deleted the push-kwztvornvskl branch June 22, 2026 10:49
tomcur added a commit to tomcur/parley that referenced this pull request Jun 23, 2026
Tango now works without options/build scripts, see
bazhenov/tango#80. Denis, the maintainer of
Tango, kindly notified us of this in
linebender#645 (comment)!

(The bump is not strictly necessary I believe, but ensures our config is
synchronized with the README of the `tango` rev we point to.)
conor-93 pushed a commit to conor-93/parley that referenced this pull request Jun 24, 2026
Tango now works without options/build scripts, see
bazhenov/tango#80. Denis, maintainer of Tango,
kindly notified us of this in
linebender#645 (comment)!

(The bump is not strictly necessary I believe, but ensures our config is
synchronized with the README of the `tango` rev we point to.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants