Skip to content

Conversation

@pinheadmz
Copy link
Member

Using a ramdisk on OSX sped up the test suite by about 5x (using default jobs=4) on my M1 macbook pro running macOS Monterey 12.3.1. This PR adds the relevant OSX commands following the Linux directions.

Default:

8204 s (accumulated) 
Runtime: 2104 s

following commands from the PR:

1606 s (accumulated) 
Runtime: 421 s

ramdisk + jobs=32:

2090 s (accumulated) 
Runtime: 85 s

@DrahtBot
Copy link
Contributor

DrahtBot commented Feb 18, 2023

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK brunoerg, jonatack, willcl-ark
Concept ACK RandyMcMillan, kristapsk
Stale ACK Sjors, stickies-v

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

@DrahtBot DrahtBot added the Docs label Feb 18, 2023
@Sjors
Copy link
Member

Sjors commented Feb 20, 2023

utACK 62ac3b4

That looks pretty much like what I use on macOS.

Copy link
Member

@willcl-ark willcl-ark left a comment

Choose a reason for hiding this comment

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

Concept ACK 62ac3b4

@RandyMcMillan
Copy link
Contributor

Concept ACK

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

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

Concept ACK

@brunoerg
Copy link
Contributor

Tested these steps on my macOS machine and it worked as expected:

➜  bitcoin-core-dev git:(master) ✗ diskutil erasevolume HFS+ ramdisk $(hdiutil attach -nomount ram://8388608)
Started erase on disk5
Unmounting disk
Erasing
Initialized /dev/rdisk5 as a 4 GB case-insensitive HFS Plus volume
Mounting disk
Finished erase on disk5 (ramdisk)

➜  bitcoin-core-dev git:(master) ✗ ./test/functional/test_runner.py --cachedir=/Volumes/ramdisk/cache --tmpdir=/Volumes/ramdisk/tmp
Temporary test directory at /Volumes/ramdisk/tmp/test_runner_₿_🏃_20230221_120656
Running Unit Tests for Test Framework Modules
..........
----------------------------------------------------------------------
Ran 10 tests in 0.595s

OK
1/260 - feature_taproot.py passed, Duration: 31 s
...

➜  bitcoin-core-dev git:(master) ✗ umount /Volumes/ramdisk

@kristapsk
Copy link
Contributor

Concept ACK

Copy link
Contributor

@stickies-v stickies-v left a comment

Choose a reason for hiding this comment

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

ACK ab6f73a1f65bcfd59fea07f3067312a757dba2f8

I use this command on my M1 too.

Copy link
Contributor

@stickies-v stickies-v left a comment

Choose a reason for hiding this comment

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

re-ACK cb7be3a

Copy link
Member

@willcl-ark willcl-ark left a comment

Choose a reason for hiding this comment

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

ACK cb7be3a237c7e5a3d09f24259be015557dc72bca

Tested on my Macbook, worked as expected and speeded up the test suite noticeably.

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

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

utACK cb7be3a237c7e5a3d09f24259be015557dc72bca

Copy link
Contributor

@brunoerg brunoerg left a comment

Choose a reason for hiding this comment

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

utACK 2f84ad7

@jonatack
Copy link
Member

jonatack commented Feb 22, 2023

ACK 2f84ad7

M1 Max, macOS 13.2

$ diskutil erasevolume HFS+ ramdisk $(hdiutil attach -nomount ram://8388608)
Started erase on disk6
Unmounting disk
Erasing
Initialized /dev/rdisk6 as a 4 GB case-insensitive HFS Plus volume
Mounting disk
Finished erase on disk6 (ramdisk)

$ diskutil info disk6 | grep -e Size
   Disk Size:                 4.3 GB (4294967296 Bytes) (exactly 8388608 512-Byte-Units)
   Device Block Size:         512 Bytes
   Allocation Block Size:     4096 Bytes

$ test/functional/test_runner.py --cachedir=/Volumes/ramdisk/cache --tmpdir=/Volumes/ramdisk/tmp
Temporary test directory at /Volumes/ramdisk/tmp/test_runner_₿_🏃_20230222_105652
..........

ALL                                                    | ✓ Passed  | 2702 s (accumulated) 
Runtime: 292 s

$ umount /Volumes/ramdisk

@willcl-ark
Copy link
Member

ACK 2f84ad7

@fanquake fanquake merged commit 32f9ce0 into bitcoin:master Feb 23, 2023
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Feb 25, 2023
2f84ad7 docs: add ramdisk guide for running tests on OSX (Matthew Zipkin)

Pull request description:

  Using a ramdisk on OSX sped up the test suite by about 5x (using default `jobs=4`) on my M1 macbook pro running macOS Monterey 12.3.1. This PR adds the relevant OSX commands following the Linux directions.

  Default:
  ```
  8204 s (accumulated)
  Runtime: 2104 s
  ```

  following commands from the PR:
  ```
  1606 s (accumulated)
  Runtime: 421 s
  ```

  ramdisk + `jobs=32`:
  ```
  2090 s (accumulated)
  Runtime: 85 s
  ```

ACKs for top commit:
  jonatack:
    ACK 2f84ad7
  willcl-ark:
    ACK 2f84ad7
  brunoerg:
    utACK 2f84ad7

Tree-SHA512: 37a9903c8ac2cbfaa91e7e73fc96ef65042ff4b15763d452af7b8615255adf03429ad01cf85265a99dd569290c1d69c05a393d616868c05c190b60b053820786
@bitcoin bitcoin locked and limited conversation to collaborators Feb 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants