Skip to content

build info tweaks#216

Merged
gameknife merged 2 commits intomainfrom
dev
Jan 13, 2026
Merged

build info tweaks#216
gameknife merged 2 commits intomainfrom
dev

Conversation

@gameknife
Copy link
Copy Markdown
Owner

  • inspect the build performance
  • stopwatch for both config & build

- inspect the build performance
- stopwatch for both config & build
@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello @gameknife, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly improves the build experience by integrating comprehensive performance monitoring and system diagnostics directly into the build process. By timing configuration and build steps, and logging system hardware details, developers gain better insights into build performance and can more easily identify bottlenecks or inconsistencies across different machines. The changes also contribute to a less cluttered build output by reducing unnecessary verbosity from underlying tools.

Highlights

  • Build Performance Monitoring: Implemented detailed timing mechanisms for both the CMake configuration and build phases in both build.ps1 (PowerShell) and build.sh (Bash) scripts, providing precise duration measurements.
  • System Information Logging: Added functionality to detect and log system hardware information (CPU model and RAM) at the start of the build process, offering valuable context for performance analysis across different environments.
  • Reduced Build Output Verbosity: Introduced options to suppress verbose output from vcpkg installations in CMakePresets.json and from MSBuild for Windows presets in build.ps1, leading to cleaner build logs. CMake developer warnings are also suppressed during configuration.
  • Enhanced Build Summary: The final build output now includes a structured 'Build Statistics' section, consolidating system information, preset used, and the measured configuration, build, and total durations.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces valuable build performance metrics and system information logging to the build scripts, which is a great enhancement for monitoring and debugging build times. The changes are well-implemented in both PowerShell and Bash scripts. My feedback includes a few suggestions to improve maintainability and consistency between the scripts, such as simplifying a conditional check in build.ps1 and improving the precision of memory reporting in build.sh.

Comment on lines +195 to +197
if ($Preset -eq "windows-dev" -or $Preset -eq "windows-base") {
$BuildArgs += @("--", "/verbosity:minimal", "/consoleloggerparameters:Summary")
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The condition to check the preset can be simplified for better readability and maintainability. Using the -like operator would cover the current presets and any future windows-* presets without needing to modify this line.

    if ($Preset -like "windows-*") {
        $BuildArgs += @("--", "/verbosity:minimal", "/consoleloggerparameters:Summary")
    }

Comment on lines +124 to +126
mem_size=$(sysctl -n hw.memsize)
mem_size=$((mem_size / 1024 / 1024 / 1024))
mem_size="${mem_size}GB"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The memory size calculation uses shell integer arithmetic, which truncates the result (e.g., 15.9 GB will be shown as 15 GB). The build.ps1 script rounds the memory to one decimal place for better precision. For consistency, consider using a tool like awk to perform floating-point division.

Suggested change
mem_size=$(sysctl -n hw.memsize)
mem_size=$((mem_size / 1024 / 1024 / 1024))
mem_size="${mem_size}GB"
local mem_bytes=$(sysctl -n hw.memsize)
local mem_gb=$(awk -v bytes="$mem_bytes" 'BEGIN { printf "%.1f", bytes / (1024*1024*1024) }')
mem_size="${mem_gb}GB"

Comment on lines +132 to +134
local mem_kb=$(grep -m1 'MemTotal' /proc/meminfo | awk '{print $2}')
local mem_gb=$((mem_kb / 1024 / 1024))
mem_size="${mem_gb}GB"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Similar to the macOS part, this memory calculation uses integer arithmetic, leading to a loss of precision. Using awk for floating-point division would provide more accurate information and be consistent with the PowerShell script.

Suggested change
local mem_kb=$(grep -m1 'MemTotal' /proc/meminfo | awk '{print $2}')
local mem_gb=$((mem_kb / 1024 / 1024))
mem_size="${mem_gb}GB"
local mem_kb=$(grep -m1 'MemTotal' /proc/meminfo | awk '{print $2}')
local mem_gb=$(awk -v kb="$mem_kb" 'BEGIN { printf "%.1f", kb / (1024*1024) }')
mem_size="${mem_gb}GB"

Comment on lines +143 to +145
local mem_bytes=$(wmic ComputerSystem get TotalPhysicalMemory | sed -n '2p' | tr -d '\r')
local mem_gb=$((mem_bytes / 1024 / 1024 / 1024))
mem_size="${mem_gb}GB"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

For consistency with other platforms and the PowerShell script, this memory calculation should also be updated to use floating-point arithmetic to avoid truncation and provide more precise information.

Suggested change
local mem_bytes=$(wmic ComputerSystem get TotalPhysicalMemory | sed -n '2p' | tr -d '\r')
local mem_gb=$((mem_bytes / 1024 / 1024 / 1024))
mem_size="${mem_gb}GB"
local mem_bytes=$(wmic ComputerSystem get TotalPhysicalMemory | sed -n '2p' | tr -d '\r')
local mem_gb=$(awk -v bytes="$mem_bytes" 'BEGIN { printf "%.1f", bytes / (1024*1024*1024) }')
mem_size="${mem_gb}GB"

@gameknife gameknife merged commit fbf0f75 into main Jan 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant