Skip to content

Speed regression under emulation when using Trixie. #1072

Description

@stumpylog

I'll be up front, I'm unsure this is an issue with this image exactly, given the myriad of things to build under emulation (buildx, qemu).

But since looking to upgrade our image to Trixie, most steps, including Python commands, have gotten noticably slower.

I've put together a toy example here:
https://github.com/stumpylog/nltk-download-reproducer

As you can see, Bookworm under emulation is around a minute to complete. Trixie is about 7 minutes. I have no idea what could have changed here. Is there missing optimization? Does Trixie use newer instructions qemu does not support?

Activity

  1. tianon commented on Aug 15, 2025

    @tianon
    Member

    I've noticed apparent emulation performance issues with other tools too (anecdotally), so I think this is more related to QEMU and/or Trixie than it is the Python image specifically. 🤔

    `hyperfine` results:

    (all tests run on a Debian Bookworm amd64 host, kernel 6.1.0-37-amd64, with qemu-user-static version 1:7.2+dfsg-7+deb12u13)

    Even for something as basic as apt-get moo (which is just a cute easter egg that prints a static ASCII art of a cow):

    $ hyperfine -L suite 'bookworm,trixie' --command-name '{suite}' --setup 'docker pull --platform linux/arm64/v8 arm64v8/debian:{suite}-slim' 'docker run --rm --platform linux/arm64/v8 arm64v8/debian:{suite}-slim apt-get moo'
    Benchmark 1: bookworm
      Time (mean ± σ):     637.0 ms ±  32.7 ms    [User: 8.6 ms, System: 5.0 ms]
      Range (min … max):   596.0 ms … 685.7 ms    10 runs
     
    Benchmark 2: trixie
      Time (mean ± σ):     698.7 ms ±  28.8 ms    [User: 7.5 ms, System: 6.1 ms]
      Range (min … max):   661.0 ms … 746.0 ms    10 runs
     
    Summary
      'bookworm' ran
        1.10 ± 0.07 times faster than 'trixie'

    More dramatic for something bigger like curl:

    $ hyperfine -L suite 'bookworm,trixie' --command-name '{suite}' --setup 'docker pull --platform linux/arm64/v8 arm64v8/buildpack-deps:{suite}-curl' 'docker run --rm --platform linux/arm64/v8 arm64v8/buildpack-deps:{suite}-curl curl https://1.1.1.1'
    Benchmark 1: bookworm
      Time (mean ± σ):      1.263 s ±  0.142 s    [User: 0.008 s, System: 0.007 s]
      Range (min … max):    1.156 s …  1.649 s    10 runs
     
    Benchmark 2: trixie
      Time (mean ± σ):      2.434 s ±  0.136 s    [User: 0.013 s, System: 0.005 s]
      Range (min … max):    2.355 s …  2.811 s    10 runs
     
    Summary
      'bookworm' ran
        1.93 ± 0.24 times faster than 'trixie'

    and even true shows a slight difference:

    $ hyperfine -L suite 'bookworm,trixie' --command-name '{suite}' --setup 'docker pull --platform linux/arm64/v8 arm64v8/buildpack-deps:{suite}-curl' 'docker run --rm --platform linux/arm64/v8 arm64v8/buildpack-deps:{suite}-curl true'
    Benchmark 1: bookworm
      Time (mean ± σ):     568.0 ms ±  34.6 ms    [User: 6.5 ms, System: 8.1 ms]
      Range (min … max):   514.6 ms … 616.1 ms    10 runs
     
    Benchmark 2: trixie
      Time (mean ± σ):     581.8 ms ±  46.7 ms    [User: 8.1 ms, System: 6.6 ms]
      Range (min … max):   517.3 ms … 636.6 ms    10 runs
     
    Summary
      'bookworm' ran
        1.02 ± 0.10 times faster than 'trixie'

    There's certainly nothing (besides updating to Trixie) that we've changed in the image that might've caused this, so it's definitely not something we've caused intentionally (and unlikely something we're going to make changes to the image to fix), so I'm going to convert this to a discussion instead. 🙇

  2. locked and limited conversation to collaborators on Aug 15, 2025
  3. converted this issue into a discussion #1073 on Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions