sandboxfs icon indicating copy to clipboard operation
sandboxfs copied to clipboard

sandboxfs performance impact on an iOS project

Open keith opened this issue 5 years ago • 4 comments

I just wanted to provide some numbers for our iOS project when using sandboxfs. If this isn't useful for you, feel free to close it.

Note: I ran clean --expunge between each build:

Default sandboxing:

% USE_BAZEL_VERSION=last_green bazelisk build --config=debug Modules/PassengerApp:Lyft
2019/03/02 12:22:49 Using unreleased version at commit 1bc7d14739e1c2359f4b91d7aff422f550a53c27
Starting local Bazel server and connecting to it...
INFO: Analysed target //Modules/PassengerApp:Lyft (320 packages loaded, 11106 targets configured).
INFO: Found 1 target...
Target //Modules/PassengerApp:Lyft up-to-date:
  bazel-bin/Modules/PassengerApp/Lyft.ipa
INFO: Elapsed time: 478.154s, Critical Path: 368.44s
INFO: 1658 processes: 1146 darwin-sandbox, 512 local.
INFO: Build completed successfully, 2172 total actions

Sandboxfs:

% USE_BAZEL_VERSION=last_green bazelisk build --config=debug Modules/PassengerApp:Lyft --experimental_use_sandboxfs --experimental_sandboxfs_path=`which sandboxfs`
22019/03/02 12:31:23 Us019/03/02 12:31:23 Using unreleased version at commit 1bc7d14739e1c2359f4b91d7aff422f550a53c27
Starting local Bazel server and connecting to it...
INFO: Analysed target //Modules/PassengerApp:Lyft (320 packages loaded, 11106 targets configured).
INFO: Found 1 target...
Target //Modules/PassengerApp:Lyft up-to-date:
  bazel-bin/Modules/PassengerApp/Lyft.ipa
INFO: Elapsed time: 662.932s, Critical Path: 592.93s
INFO: 1658 processes: 1146 darwin-sandbox, 512 local.
INFO: Build completed successfully, 2172 total actions

Local:

% USE_BAZEL_VERSION=last_green bazelisk build --config=debug Modules/PassengerApp:Lyft --config=nosandbox
2019/03/02 12:43:33 Using unreleased version at commit 1bc7d14739e1c2359f4b91d7aff422f550a53c27
Starting local Bazel server and connecting to it...
INFO: Analysed target //Modules/PassengerApp:Lyft (320 packages loaded, 11106 targets configured).
INFO: Found 1 target...
Target //Modules/PassengerApp:Lyft up-to-date:
  bazel-bin/Modules/PassengerApp/Lyft.ipa
INFO: Elapsed time: 265.130s, Critical Path: 207.45s
INFO: 1658 processes: 1658 local.
INFO: Build completed successfully, 2172 total actions

I can't provide the full project to reproduce this, but if there's any other specific questions I can answer I can try to provide other useful info

keith avatar Mar 02 '19 20:03 keith

Interesting. Is this with the release binary of sandboxfs 0.1.0 in the repository or with a custom build? If the latter, just double-checking if you built it in --release mode?

jmmv avatar Mar 02 '19 22:03 jmmv

I had gone through the cargo install path from crates.io (although --version did report 0.1.0). I've reinstalled with the 0.1.0 pkg and here was run with that:

% USE_BAZEL_VERSION=last_green bazelisk build --config=debug Modules/PassengerApp:Lyft --experimental_use_sandboxfs --experimental_sandboxfs_path=`which sandboxfs`
2019/03/02 14:24:07 Using unreleased version at commit 1bc7d14739e1c2359f4b91d7aff422f550a53c27
Starting local Bazel server and connecting to it...
INFO: Analysed target //Modules/PassengerApp:Lyft (320 packages loaded, 11106 targets configured).
INFO: Found 1 target...
Target //Modules/PassengerApp:Lyft up-to-date:
  bazel-bin/Modules/PassengerApp/Lyft.ipa
INFO: Elapsed time: 637.240s, Critical Path: 545.63s
INFO: 1658 processes: 1146 darwin-sandbox, 512 local.
INFO: Build completed successfully, 2172 total actions

keith avatar Mar 02 '19 22:03 keith

I just wanted to ensure that the binary was built with --release as otherwise it can be quite slow. So, to summarize:

No sandbox: Elapsed time: 265.130s, Critical Path: 207.45s symlinked sandbox: Elapsed time: 478.154s, Critical Path: 368.44s sandboxfs sandbox: Elapsed time: 637.240s, Critical Path: 545.63s

Correct? Not great! Unfortunately this doesn't match what I have observed so far, so I'll need more information to understand what's going on. Can you provide some? Like machine type, maybe the "type" of your build, if you noticed sandboxfs using significant CPU during the build... I don't know, anything you can share that's not confidential :P

jmmv avatar Mar 03 '19 19:03 jmmv

This is the hardware I'm testing on image

What details would you like for the "type" of build? In general this is an iOS app with ~10K files for this build and ~1k rules.

I didn't notice significant CPU use but I can run it again and pay more attention to that

keith avatar Mar 08 '19 06:03 keith