Skip to content

Use exec to avoid an unnecessary subprocess being started by the Python wrapper and AppRun #90

@mxmlnkn

Description

@mxmlnkn

I think this line:

should be changed to:

exec {{ entrypoint }}

This would avoid another unnecessary subprocess being spawned, which would reduce resource usage and also unclutter the view in htop and other process manager tools.

Other files, such as entrypoint.sh and apprun.sh might also profit from this optimization.

Extracting python3.13.5-cp313-cp313-manylinux2014_x86_64.AppImage with --appimage-extract and executing squashfs-root/AppRun -c 'import time; time.sleep(60)' & inside a manylinux Docker and visualizing it with htop, yields:

Image

This is unexpectedly one level more shallow than I thought. The reason for that seems to be that AppRun is a symlink to usr/bin/python3.13. Normally, after adding a custom entry point, the process tree would have one more level when exec is not used.

After adding the exec, it looks like this:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions