-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimize UserDumpParser::GetMemBlock (#17)
Co-authored-by: 0vercl0k <[email protected]>
- Loading branch information
Showing
7 changed files
with
85 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,174 +2,109 @@ name: Builds | |
|
||
on: [push, pull_request] | ||
|
||
|
||
jobs: | ||
parser: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
variant: | ||
- {os: windows-latest, generator: msvc, arch: x64, config: RelWithDebInfo} | ||
- {os: windows-latest, generator: ninja, arch: x64, config: RelWithDebInfo} | ||
- {os: windows-latest, generator: msvc, arch: win32, config: RelWithDebInfo} | ||
- {os: windows-latest, generator: msvc, arch: arm64, config: RelWithDebInfo} | ||
- {os: ubuntu-latest, generator: gcc, arch: x64, config: RelWithDebInfo} | ||
- {os: ubuntu-latest, generator: clang, arch: x64, config: RelWithDebInfo} | ||
- {os: macos-latest, generator: clang, arch: x64, config: Release} | ||
# Available runners: https://github.com/actions/runner-images | ||
- {os: windows-2019, generator: msvc, arch: x64, config: RelWithDebInfo, } | ||
- {os: windows-2019, generator: msvc, arch: win32, config: RelWithDebInfo, } | ||
- {os: windows-2019, generator: msvc, arch: arm64, config: RelWithDebInfo, } | ||
- {os: ubuntu-22.04, generator: gcc, arch: x64, config: RelWithDebInfo, } | ||
- {os: ubuntu-22.04, generator: clang, arch: x64, config: RelWithDebInfo, } | ||
- {os: ubuntu-24.04, generator: gcc, arch: x64, config: RelWithDebInfo, } | ||
- {os: ubuntu-24.04, generator: clang, arch: x64, config: RelWithDebInfo, } | ||
- {os: macos-13, generator: clang, arch: x64, config: Release, } | ||
# - {os: macos-13-xlarge, generator: clang, arch: arm64, config: Release, } # Paying runner | ||
- {os: macos-14, generator: clang, arch: arm64, config: Release, } | ||
# - {os: macos-14-large, generator: clang, arch: x64, config: Release, } # Paying runner | ||
runs-on: ${{ matrix.variant.os }} | ||
name: parser / ${{ matrix.variant.os }} / ${{ matrix.variant.generator }} / ${{ matrix.variant.arch }} | ||
env: | ||
NB_CPU: 1 | ||
CMAKE_FLAGS: "-DBUILD_PARSER:BOOL=ON -DBUILD_PYTHON_BINDING:BOOL=OFF" | ||
CMAKE_ARCH: "" | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Environment Setup (Windows) | ||
if: matrix.variant.os == 'windows-latest' | ||
if: matrix.variant.os == 'windows-2019' | ||
run: | | ||
echo "NB_CPU=$env:NUMBER_OF_PROCESSORS" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
echo "CMAKE_ARCH='-A ${{ matrix.variant.arch }}'" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
Import-Module .\.github\Invoke-VisualStudio.ps1 | ||
Invoke-VisualStudio2022${{ matrix.variant.arch }} | ||
echo "CMAKE_ARCH='-A ${{ matrix.variant.arch }}'" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
- name: Environment Setup (Linux) | ||
if: matrix.variant.os == 'ubuntu-latest' | ||
if: matrix.variant.os == 'ubuntu-22.04' | ||
run: | | ||
sudo apt-get -y update | ||
echo "NB_CPU=$(grep -c ^processor /proc/cpuinfo)" >> $GITHUB_ENV | ||
sudo apt update | ||
- name: Environment Setup (Linux/GCC) | ||
if: matrix.variant.os == 'ubuntu-latest' && matrix.variant.generator == 'gcc' | ||
if: matrix.variant.os == 'ubuntu-22.04' && matrix.variant.generator == 'gcc' | ||
run: | | ||
sudo apt install -y g++ ninja-build | ||
sudo apt install -y g++ | ||
echo CC=gcc >> $GITHUB_ENV | ||
echo CXX=g++ >> $GITHUB_ENV | ||
- name: Environment Setup (Linux/CLang) | ||
if: matrix.variant.os == 'ubuntu-latest' && matrix.variant.generator == 'clang' | ||
if: matrix.variant.os == 'ubuntu-22.04' && matrix.variant.generator == 'clang' | ||
run: | | ||
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" | ||
echo CC=clang >> $GITHUB_ENV | ||
echo CXX=clang++ >> $GITHUB_ENV | ||
- name: Environment Setup (MacOS) | ||
if: matrix.variant.os == 'macos-latest' | ||
run: | | ||
echo NB_CPU=$(sysctl -n hw.ncpu) >> $GITHUB_ENV | ||
- name: Build | ||
run: | | ||
mkdir build | ||
mkdir artifact | ||
cmake -S ./src -B ./build ${{ env.CMAKE_ARCH }} ${{ env.CMAKE_FLAGS }} | ||
cmake --build ./build --verbose --config ${{ matrix.variant.config }} --parallel ${{ env.NB_CPU }} | ||
cmake --install ./build --config ${{ matrix.variant.config }} --prefix ./artifact --verbose | ||
cmake --build ./build --verbose --config ${{ matrix.variant.config }} | ||
cmake --install ./build --config ${{ matrix.variant.config }} --prefix ./artifact | ||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: parser-${{ matrix.variant.os }}.${{ matrix.variant.generator }}-${{ matrix.variant.arch }}.${{ matrix.variant.config }} | ||
name: parser-${{ matrix.variant.os }}.${{ matrix.variant.generator }}-${{ matrix.variant.arch }}.${{ matrix.variant.config }}-${{ github.sha }} | ||
path: artifact/ | ||
|
||
bindings: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# nanobind does not support Python < 3.8. | ||
python-version: ['3.8', '3.9', '3.10', '3.11'] | ||
variant: | ||
- {os: windows-latest, generator: msvc, arch: x64, config: RelWithDebInfo, py-arch: x64} | ||
- {os: windows-latest, generator: msvc, arch: win32, config: RelWithDebInfo, py-arch: x86} | ||
# - {os: windows-latest, generator: msvc, arch: arm64, config: RelWithDebInfo, py-arch: x64} # Unsupported (see https://raw.githubusercontent.com/actions/python-versions/main/versions-manifest.json) | ||
- {os: ubuntu-latest, generator: gcc, arch: x64, config: RelWithDebInfo, py-arch: x64} | ||
- {os: ubuntu-latest, generator: clang, arch: x64, config: RelWithDebInfo, py-arch: x64} | ||
- {os: macos-latest, generator: clang, arch: x64, config: Release, py-arch: x64} | ||
# Available runners: https://github.com/actions/runner-images | ||
- {os: windows-2019, config: RelWithDebInfo } | ||
- {os: ubuntu-22.04, config: RelWithDebInfo } | ||
# most up to date free intel based osx? | ||
- {os: macos-13, config: Release } | ||
runs-on: ${{ matrix.variant.os }} | ||
name: bindings / ${{ matrix.variant.os }} / ${{ matrix.variant.generator }} / ${{ matrix.python-version }} / ${{ matrix.variant.arch }} | ||
name: bindings / ${{ matrix.variant.os }} | ||
env: | ||
NB_CPU: 1 | ||
CMAKE_FLAGS: "-DBUILD_PARSER:BOOL=OFF -DBUILD_PYTHON_BINDING:BOOL=ON" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Python | ||
uses: actions/setup-python@v4 | ||
- name: Build / test wheels | ||
uses: pypa/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: ${{ matrix.variant.py-arch }} | ||
|
||
- name: Install Python pre-requisites | ||
run: | | ||
python -m pip install --upgrade pip setuptools wheel | ||
python -m pip install --user --upgrade -r src/python/requirements.txt | ||
- name: Environment Setup (Windows) | ||
if: matrix.variant.os == 'windows-latest' | ||
run: | | ||
echo "NB_CPU=$env:NUMBER_OF_PROCESSORS" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
echo "CMAKE_ARCH='-A ${{ matrix.variant.arch }}'" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | ||
Import-Module .\.github\Invoke-VisualStudio.ps1 | ||
Invoke-VisualStudio2022${{ matrix.variant.arch }} | ||
- name: Environment Setup (Linux) | ||
if: matrix.variant.os == 'ubuntu-latest' | ||
run: | | ||
sudo apt-get -y update | ||
echo "NB_CPU=$(grep -c ^processor /proc/cpuinfo)" >> $GITHUB_ENV | ||
- name: Environment Setup (Linux/GCC) | ||
if: matrix.variant.os == 'ubuntu-latest' && matrix.variant.generator == 'gcc' | ||
run: | | ||
sudo apt install -y g++ ninja-build | ||
echo CC=gcc >> $GITHUB_ENV | ||
echo CXX=g++ >> $GITHUB_ENV | ||
- name: Environment Setup (Linux/CLang) | ||
if: matrix.variant.os == 'ubuntu-latest' && matrix.variant.generator == 'clang' | ||
run: | | ||
sudo bash -c "$(wget -O - https://apt.llvm.org/llvm.sh)" | ||
echo CC=clang >> $GITHUB_ENV | ||
echo CXX=clang++ >> $GITHUB_ENV | ||
- name: Environment Setup (MacOS) | ||
if: matrix.variant.os == 'macos-latest' | ||
run: | | ||
echo NB_CPU=$(sysctl -n hw.ncpu) >> $GITHUB_ENV | ||
- name: Build | ||
run: | | ||
mkdir build | ||
mkdir artifact | ||
cmake -S ./src -B ./build ${{ env.CMAKE_ARCH }} ${{ env.CMAKE_FLAGS }} | ||
cmake --build ./build --verbose --config ${{ matrix.variant.config }} --parallel ${{ env.NB_CPU }} | ||
cmake --install ./build --config ${{ matrix.variant.config }} --prefix ./artifact --verbose | ||
- name: Python Binding Tests | ||
run: | | ||
cd src/python | ||
python -m pip install -r tests/requirements.txt -U | ||
python -m pip install --user -U . | ||
pytest -vvv ./tests | ||
cd ../.. | ||
- name: Build wheel | ||
run: | | ||
cd src/python | ||
mkdir ../../wheel | ||
python -m pip wheel . -w ../../wheel | ||
cd ../.. | ||
package-dir: ./src/python | ||
|
||
- name: Upload wheel | ||
uses: actions/upload-artifact@v3 | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: wheels | ||
path: wheel/*.whl | ||
|
||
- name: Upload artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: python-${{ matrix.variant.os }}.${{ matrix.variant.generator }}-${{ matrix.variant.arch }}.${{ matrix.variant.config }} | ||
path: artifact/ | ||
name: wheels-${{ matrix.variant.os }} | ||
path: ./wheelhouse/*.whl | ||
|
||
merge: | ||
runs-on: ubuntu-latest | ||
needs: bindings | ||
steps: | ||
- name: Merge Artifacts | ||
uses: actions/upload-artifact/merge@v4 | ||
with: | ||
name: wheels | ||
pattern: wheels-* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters