perf(engine): optimize snakeOccupies and BFS collision checks - #37
Conversation
Replace array slice/some in snakeOccupies with direct loop and precompute occupied segments Set bitmask in findNextDirection/findPathToLevel to convert O(N) lookup to O(1).
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the 鈿欙笍 Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
馃挕 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: adc9024366
鈩癸笍 About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 馃憤.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - _APP_LOCALE=en | ||
| - _APP_OPTIONS_ABUSE=disabled | ||
| - _APP_OPENSSL_KEY_V1=your-secret-key | ||
| - _APP_OPENSSL_KEY_V1=${APP_OPENSSL_KEY_V1:-your-secret-key} |
There was a problem hiding this comment.
Align the secret interpolation with the new test
The CI quality job runs bun test in .github/workflows/ci.yml, but the newly added __tests__/docker-compose.test.ts unconditionally rejects your-secret-key and requires the exact value _APP_OPENSSL_KEY_V1=${APPWRITE_SECRET_KEY}. This line instead retains the rejected literal as a fallback and uses APP_OPENSSL_KEY_V1, so both assertions fail on every fully installed test run and block the build.
Useful? React with 馃憤聽/ 馃憥.
Replace array slice/some in snakeOccupies with direct loop and precompute occupied segments Set bitmask in findNextDirection/findPathToLevel to convert O(N) lookup to O(1).