René's URL Explorer Experiment


Title: Reduce Async FrameBuffer memory usage with PackedWrappedBuffer and static offsets by JasperGeurtz · Pull Request #109 · JavaBWAPI/JBWAPI · GitHub

Open Graph Title: Reduce Async FrameBuffer memory usage with PackedWrappedBuffer and static offsets by JasperGeurtz · Pull Request #109 · JavaBWAPI/JBWAPI

X Title: Reduce Async FrameBuffer memory usage with PackedWrappedBuffer and static offsets by JasperGeurtz · Pull Request #109 · JavaBWAPI/JBWAPI

Description: #90 Reduce async FrameBuffer memory from 33.0 MB to 4.08 MB per slot (-88%) (#90): Route static map/region reads (groundHeight, isWalkable, isBuildable, regions) directly to the main shared memory buffer via ClientDataAsync. Omit client-to-server output buffers (strings, shapes, commands, unitCommands) from FrameBuffer (flushed directly to liveGameData via SideEffectQueue). Pack the remaining 3 dynamic ranges into PackedWrappedBuffer (4.08 MB) using pre-shifted slice2 and slice3 buffer views on WrappedBuffer so generated ClientDataAsync methods use compile-time BWAPI offsets for both unpacked liveData and packed FrameBuffer slots with zero runtime branches. Only copy active units, events, and eventStrings per frame: Track maxUnitCount (via initialUnitCount and UnitDiscover events) and skip copying the unused tails of units[10000], events[10000], and eventStrings[1000]. Reduces per-frame copy size from 4.80 MB (and 330 MB on Frame 0) to ~450 KB at game start, ~685 KB in mid-game, and ~1.19 MB in late-game (~0.05–0.20 ms on normal hardware). Keep asyncUnsafe buffer handoffs on a single reference without volatile read overhead: Attach final slice2 and slice3 views directly to WrappedBuffer (this on unpacked buffers, shifted views on PackedWrappedBuffer) with a storeFence() in setBuffer, so all dynamic slices switch through the single ClientData.buffer reference without penalizing getter reads with volatile. Swap from liveData onto frameBuffer.peek() (and clear unsafeReadReady) immediately after enqueueFrame() completes (~0.05–0.35 ms), giving any JIT-cached buffer reference the remaining ~39.7+ ms while liveData is still frozen to transition before control returns to StarCraft. Consolidate async locks and eliminate spurious wakeups: Consolidate lockWrite, synchronized framesBuffered(), unsafeReadReadyLock, and lastBotThrowLock onto frameBuffer.lockSize (and volatile lastBotThrow), and stop signalAll() when clearing unsafeReadReady = false. Double-buffer SideEffectQueue: Swap queue and flushQueue under the monitor and apply side effects to liveGameData outside the lock so the bot thread is not blocked on enqueue() during shared-memory flushes.

Open Graph Description: #90 Reduce async FrameBuffer memory from 33.0 MB to 4.08 MB per slot (-88%) (#90): Route static map/region reads (groundHeight, isWalkable, isBuildable, regions) directly to the main shared memor...

X Description: #90 Reduce async FrameBuffer memory from 33.0 MB to 4.08 MB per slot (-88%) (#90): Route static map/region reads (groundHeight, isWalkable, isBuildable, regions) directly to the main shared memor...

Opengraph URL: https://github.com/JavaBWAPI/JBWAPI/pull/109

X: @github

direct link

Domain: redirect.github.com

IPv4 address: 140.82.114.4

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:4b4ae06f-2321-c5b2-05bd-ee265eae8f56
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idBE14:1649B1:7010DB:91E620:6B0628F6
html-safe-nonce8710284729525a30bd40dff8583cd2acb6499387d43832d0416149faa2671451
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRTE0OjE2NDlCMTo3MDEwREI6OTFFNjIwOjZCMDYyOEY2IiwidmlzaXRvcl9pZCI6IjI5OTg0NjYxODMyMzk3MDY4NzAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac3c94a622879a6336ba02b34032552ac55e3f51c210ec8c2acb27d60ad2b1da30
hovercard-subject-tagpull_request:5201417823
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/JavaBWAPI/JBWAPI/pull/109/files
twitter:imagehttps://avatars.githubusercontent.com/u/10107858?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/10107858?s=400&v=4
og:image:alt#90 Reduce async FrameBuffer memory from 33.0 MB to 4.08 MB per slot (-88%) (#90): Route static map/region reads (groundHeight, isWalkable, isBuildable, regions) directly to the main shared memor...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None9e10bb0ecc0bd0f8692aa89586ee9b54e498d7ab9f244a44cdb5b93653a125ce
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/JavaBWAPI/JBWAPI git https://github.com/JavaBWAPI/JBWAPI.git
octolytics-dimension-user_id46279254
octolytics-dimension-user_loginJavaBWAPI
octolytics-dimension-repository_id149718845
octolytics-dimension-repository_nwoJavaBWAPI/JBWAPI
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id149718845
octolytics-dimension-repository_network_root_nwoJavaBWAPI/JBWAPI
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release32e57d5cc2ce6ce92ec6dceb65858344750c27c2
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#start-of-content
https://redirect.github.com/
Sign inhttps://redirect.github.com/login?return_to=https%3A%2F%2Fgithub.com%2FJavaBWAPI%2FJBWAPI%2Fpull%2F109%2Ffiles
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://redirect.github.com/login?return_to=https%3A%2F%2Fgithub.com%2FJavaBWAPI%2FJBWAPI%2Fpull%2F109%2Ffiles
Sign uphttps://redirect.github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=JavaBWAPI%2FJBWAPI
Reloadhttps://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files
Reloadhttps://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files
Reloadhttps://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files
JavaBWAPIhttps://redirect.github.com/JavaBWAPI
JBWAPIhttps://redirect.github.com/JavaBWAPI/JBWAPI
Codehttps://redirect.github.com/JavaBWAPI/JBWAPI
Issues11 (11)https://redirect.github.com/JavaBWAPI/JBWAPI/issues
Pull requests4 (4)https://redirect.github.com/JavaBWAPI/JBWAPI/pulls
Actionshttps://redirect.github.com/JavaBWAPI/JBWAPI/actions
Security and qualityhttps://redirect.github.com/JavaBWAPI/JBWAPI/security
Insightshttps://redirect.github.com/JavaBWAPI/JBWAPI/insights
Sign up for GitHub https://redirect.github.com/signup?return_to=%2FJavaBWAPI%2FJBWAPI%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://redirect.github.com/login?return_to=%2FJavaBWAPI%2FJBWAPI%2Fissues%2Fnew%2Fchoose
JasperGeurtzhttps://redirect.github.com/JasperGeurtz
develophttps://redirect.github.com/JavaBWAPI/JBWAPI/tree/develop
packed-frame-bufferhttps://redirect.github.com/JavaBWAPI/JBWAPI/tree/packed-frame-buffer
Conversation 2 https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109
Commits 7 https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/commits
Checks 11 https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/checks
Files changed https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files
Please reload this pagehttps://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files
Reduce Async FrameBuffer memory usage with PackedWrappedBuffer and static offsets https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#top
Show all changes 7 commits https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files
747eaab Reduce Async FrameBuffer memory usage with PackedWrappedBuffer and st… Nov 7, 2026 https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/commits/747eaab99e7483caa81324b7c13365571748a764
02eb1e4 Only copy active units, events, and eventStrings in FrameBuffer Nov 7, 2026 https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/commits/02eb1e49b2d8c9c2712b8385611fcb5e6d3b91a4
f8432aa Defer asyncUnsafe buffer swap to frame timeout in BotWrapperAsync Nov 8, 2026 https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/commits/f8432aa786c98e8c36f3b6569508fd8566d061c4
c955502 Consolidate locks and eliminate spurious wakeups in BotWrapperAsync a… Nov 8, 2026 https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/commits/c955502b7e931e067944a8fc38e892931853b715
a259143 Double-buffer SideEffectQueue to avoid blocking enqueue during flush Nov 8, 2026 https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/commits/a259143f89c10dbd444f4cdb1ba5069fc7958919
2cd8e37 Rename AsyncClientData to ClientDataAsync Nov 8, 2026 https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/commits/2cd8e37440e998b07de0f28913b70067f9b95932
80e2a50 Unify async buffer handoffs onto ClientData.buffer and swap after copy Nov 16, 2026 https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/commits/80e2a5078ab0b6148e548975f4406ec908425f25
Clear filters https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files
Please reload this pagehttps://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files
Please reload this pagehttps://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files
BotWrapper.java https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-d8604d3e1a8dd91832ff7b67543d36a308db711ed0b6b49b5a99263117e754b7
BotWrapperAsync.java https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-b0a134fd888324e98f526b81cdcd354cb74bb52652aba1aac2346094d5180e65
ClientData.java https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-00830ad64f5d24ba2aa17119d56dc078851f08d9548c5e387fb603d357495464
ClientDataAsync.java https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-2e85a8c67cd801c6b75f71108a9afbdccae6cd7dbb4c1d80f11fb6249cb83f0d
FrameBuffer.java https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-d22ae7cc9337b296dafc9fce0d77c437f4bcf4754b75a3ca52eb038930049349
Game.java https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-205d857a5fb5f2002e81b03dfd1838464ec7487bc4c344d8be27e791b3ba97cc
PackedWrappedBuffer.java https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-05195348658387f5e78315f56e2104291ecf3e5c7b459b39345c7be8011d17f0
SideEffectQueue.java https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-bc63edc781b0f0b6537abdfb09c4805dab49962cbb17cf8c071db2e7c5229ac0
WrappedBuffer.java https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-f05e14eb9a939f6122c02c97c4e9d6314023e71efb367bfb9cc814b16c60df2d
DumpToClient.java https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-60bea109a7049b01c32bd66cf410c379bc3a56c177eb41bd9fe482b768edc25a
ClientDataAsyncTest.java https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-7a4535bc4939386ebd967f5da4f654f10ae79dba04a2ba4f82339c132c8e47d8
SynchronizationEnvironment.java https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-b13330409f76211c0f221280ef0975e881191b456a95dd8fae63dc46bf5d678b
SynchronizationTest.java https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-cecb2f8a87f27fd53ae921e2f11dd1d42c491ca1769078104c38f311ba38b689
src/main/java/bwapi/BotWrapper.javahttps://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-d8604d3e1a8dd91832ff7b67543d36a308db711ed0b6b49b5a99263117e754b7
View file https://redirect.github.com/JavaBWAPI/JBWAPI/blob/80e2a5078ab0b6148e548975f4406ec908425f25/src/main/java/bwapi/BotWrapper.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/{{ revealButtonHref }}
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-d8604d3e1a8dd91832ff7b67543d36a308db711ed0b6b49b5a99263117e754b7
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-d8604d3e1a8dd91832ff7b67543d36a308db711ed0b6b49b5a99263117e754b7
src/main/java/bwapi/BotWrapperAsync.javahttps://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-b0a134fd888324e98f526b81cdcd354cb74bb52652aba1aac2346094d5180e65
View file https://redirect.github.com/JavaBWAPI/JBWAPI/blob/80e2a5078ab0b6148e548975f4406ec908425f25/src/main/java/bwapi/BotWrapperAsync.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/{{ revealButtonHref }}
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-b0a134fd888324e98f526b81cdcd354cb74bb52652aba1aac2346094d5180e65
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-b0a134fd888324e98f526b81cdcd354cb74bb52652aba1aac2346094d5180e65
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-b0a134fd888324e98f526b81cdcd354cb74bb52652aba1aac2346094d5180e65
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-b0a134fd888324e98f526b81cdcd354cb74bb52652aba1aac2346094d5180e65
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-b0a134fd888324e98f526b81cdcd354cb74bb52652aba1aac2346094d5180e65
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-b0a134fd888324e98f526b81cdcd354cb74bb52652aba1aac2346094d5180e65
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-b0a134fd888324e98f526b81cdcd354cb74bb52652aba1aac2346094d5180e65
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-b0a134fd888324e98f526b81cdcd354cb74bb52652aba1aac2346094d5180e65
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-b0a134fd888324e98f526b81cdcd354cb74bb52652aba1aac2346094d5180e65
src/main/java/bwapi/ClientData.javahttps://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-00830ad64f5d24ba2aa17119d56dc078851f08d9548c5e387fb603d357495464
View file https://redirect.github.com/JavaBWAPI/JBWAPI/blob/80e2a5078ab0b6148e548975f4406ec908425f25/src/main/java/bwapi/ClientData.java
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/{{ revealButtonHref }}
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-00830ad64f5d24ba2aa17119d56dc078851f08d9548c5e387fb603d357495464
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-00830ad64f5d24ba2aa17119d56dc078851f08d9548c5e387fb603d357495464
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-00830ad64f5d24ba2aa17119d56dc078851f08d9548c5e387fb603d357495464
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-00830ad64f5d24ba2aa17119d56dc078851f08d9548c5e387fb603d357495464
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-00830ad64f5d24ba2aa17119d56dc078851f08d9548c5e387fb603d357495464
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-00830ad64f5d24ba2aa17119d56dc078851f08d9548c5e387fb603d357495464
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-00830ad64f5d24ba2aa17119d56dc078851f08d9548c5e387fb603d357495464
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-00830ad64f5d24ba2aa17119d56dc078851f08d9548c5e387fb603d357495464
https://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files#diff-00830ad64f5d24ba2aa17119d56dc078851f08d9548c5e387fb603d357495464
Please reload this pagehttps://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files
Please reload this pagehttps://redirect.github.com/JavaBWAPI/JBWAPI/pull/109/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlno-cache

Viewport: width=device-width


URLs of crawlers that visited me.