Skip to content

Measuring and optimizing try's overhead #156

Open

Description

@ezrizhu

Below loop takes 0.086338005s

try/try

Lines 109 to 117 in 55a7619

while IFS="" read -r mountpoint
do
## Only make the directory if the original is a directory too
if [ -d "$mountpoint" ] && ! [ -L "$mountpoint" ]
then
# shellcheck disable=SC2174 # warning acknowledged, "When used with -p, -m only applies to the deepest directory."
mkdir -m "$(stat -c %a "$mountpoint")" -p "${SANDBOX_DIR}/upperdir/${mountpoint}" "${SANDBOX_DIR}/workdir/${mountpoint}" "${SANDBOX_DIR}/temproot/${mountpoint}"
fi
done <"$DIRS_AND_MOUNTS"

each unionhelper mount takes around 0.011723267s
each normal overlay mount takes around 0.005518701s

0.004118806 Entrypoint
0.001737423 Finish Parseopt
0.001615350 Start of try()
0.003911111 Determining sandboxdir
0.009549844 Docker handling
0.004255040 Making upperdir, workdir, temproot
0.004132450 Enumerating direcotories to mount
0.006334729 EnumDir: find
0.006502962 EnumDir: findmnt
0.003777117 EnumDir: sort
0.005552995 EnumDir: MultiLowerDir
0.084236389 Prepare sandboxes before unshare
0.005717082 set temproot permission
0.016709205 Writing tempfiles
0.001816768 Disable job control
0.005136067 Outer unshare
0.001934788 Union helper detection
0.105242101 Mounting overlays
0.030229675 Mounting devices
0.012676495 Inner unshare
0.009892223 sync
0.029609429 unmounting devices
0.011026003 Exitting inner unshare
0.019649394 Symlinks cleanup
0.008201226 Summary
0.001717618 End of try
0.001631593 date test 1

Activity

  1. mgree commented on May 20, 2024

    @mgree
    Contributor

    Interesting! Is there a way for you to automate this process and check the overheads on a few different machines?

    Can you count the overhead of the two calls to date, too? (You can do this by just running it with an empty block.)

  2. ezrizhu commented on May 20, 2024

    @ezrizhu
    MemberAuthor

    sure, i'll do them on our CI machine under different distros and also some of my other machines

  3. self-assigned this
    on May 26, 2024
  4. ezrizhu commented on May 28, 2024

    @ezrizhu
    MemberAuthor

    Can you count the overhead of the two calls to date, too? (You can do this by just running it with an empty block.)
    updated, see date test 1

    Dev VM: https://bns.sh/i3.txt
    Intel(R) Xeon(R) CPU E5-2680 v2 @ 2.80GHz (40): http://bns.sh/iC.txt
    Intel(R) Xeon(R) CPU E3-1230 v5 @ 3.40GHz (8): http://bns.sh/iY.txt
    AMD Ryzen 7 3700X 8-Core Processor (16): https://bns.sh/iR.txt

    I'll work with @gliargovas to get them ran on the pi cluster at brown aswell, then setting up some CI jobs to automatically run them after we determine the machine set that we're using.

  5. changed the title [-]Optimization[/-] [+]Measuring and optimizing try's overhead[/+] on Jun 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

performancePerformance measurement and improvements

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions