Skip to content

Commit a09d06a

Browse files
committed
bootstrap optimizations to reduce pesky ANR reports which are apparently negatively affecting my Google Play visibility
1 parent af78e4e commit a09d06a

16 files changed

Lines changed: 280 additions & 104 deletions

File tree

.efrocachemap

Lines changed: 56 additions & 55 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
### 1.7.48 (build 22498, api 9, 2025-08-14)
2+
- Added Kazakh language (Thanks KAZDOG!)
3+
- The 'Logging' dev-console-tab is now 'LogLevels'. I kept finding myself going
4+
there to look for log output. Maybe this will help.
5+
16
### 1.7.47 (build 22495, api 9, 2025-08-13)
27
- All communication with the V1 (Legacy) master server is now tunneled through
38
the nearest regional server (the V2Transport connection). This reduces the

config/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cpplint==2.0.2
22
cryptography==45.0.6
33
dmgbuild==1.6.5
4-
filelock==3.18.0
4+
filelock==3.19.1
55
furo==2025.7.19
66
libcst==1.8.2
77
mypy==1.17.1
@@ -17,7 +17,7 @@ requests==2.32.4
1717
Sphinx==8.2.3
1818
tomlkit==0.13.3
1919
types-certifi==2021.10.8.3
20-
types-docutils==0.21.0.20250809
20+
types-docutils==0.22.0.20250814
2121
types-filelock==3.2.7
2222
types-requests==2.32.4.20250809
2323
typing_extensions==4.14.1

src/assets/.asset_manifest_private.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@
451451
"ba_data/data/languages/hungarian.json",
452452
"ba_data/data/languages/indonesian.json",
453453
"ba_data/data/languages/italian.json",
454+
"ba_data/data/languages/kazakh.json",
454455
"ba_data/data/languages/korean.json",
455456
"ba_data/data/languages/malay.json",
456457
"ba_data/data/languages/persian.json",

src/assets/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3160,6 +3160,7 @@ DATA_TARGETS = \
31603160
$(BUILD_DIR)/ba_data/data/languages/hungarian.json \
31613161
$(BUILD_DIR)/ba_data/data/languages/indonesian.json \
31623162
$(BUILD_DIR)/ba_data/data/languages/italian.json \
3163+
$(BUILD_DIR)/ba_data/data/languages/kazakh.json \
31633164
$(BUILD_DIR)/ba_data/data/languages/korean.json \
31643165
$(BUILD_DIR)/ba_data/data/languages/malay.json \
31653166
$(BUILD_DIR)/ba_data/data/languages/persian.json \

src/assets/ba_data/python/babase/_devconsole.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ def __init__(self) -> None:
155155
DevConsoleTabEntry('Python', DevConsoleTabPython),
156156
DevConsoleTabEntry('AppModes', DevConsoleTabAppModes),
157157
DevConsoleTabEntry('UI', DevConsoleTabUI),
158-
DevConsoleTabEntry('Logging', DevConsoleTabLogging),
158+
DevConsoleTabEntry('LogLevels', DevConsoleTabLogging),
159159
]
160160
if os.environ.get('BA_DEV_CONSOLE_TEST_TAB', '0') == '1':
161161
self.tabs.append(DevConsoleTabEntry('Test', DevConsoleTabTest))

src/assets/ba_data/python/babase/_env.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,12 @@ def on_main_thread_start_app() -> None:
192192

193193

194194
def _bootstrap_networking() -> None:
195+
"""Early networking bootstrapping.
196+
197+
We start this as early as we can after start-app is called to
198+
give it as much time to warm-start network connections/etc. while
199+
we're spinning up other stuff.
200+
"""
195201

196202
from efro.util import strict_partial
197203

@@ -219,11 +225,15 @@ def _bootstrap_networking() -> None:
219225
maxsize=10,
220226
headers={'User-Agent': _babase.user_agent_string()},
221227
)
222-
# Kick off a request to our first-choice bootstrap server. This will
228+
# Kick off a request to our first-choice bootstrap server. This can
223229
# get dns lookup and ssl negotiation and whatnot going in the
224230
# background while the rest of our app is coming up, and our first
225231
# actual request to the server will ideally have an established
226232
# connection already waiting for it.
233+
#
234+
# We kick off a separate thread to handle this though since we don't
235+
# want the bootstrap process to block on it if its still going when
236+
# our bootstrapping results are needed.
227237
threading.Thread(
228238
target=strict_partial(
229239
_warm_start_bootstrap_connection, _g_net_warm_start_pool_manager
@@ -296,13 +306,14 @@ def should_abort() -> bool:
296306
or appstate is appstate_t.SHUTDOWN_COMPLETE
297307
)
298308

299-
# Let's wait until the app has been in the running state for a few
300-
# seconds before doing our thing; that way we're out of the way of
301-
# more high priority stuff like meta-scans that happen at first
302-
# launch.
309+
# Let's wait until the app has been in the running state for a wee
310+
# bit before doing our thing; that way we're out of the way of more
311+
# high priority stuff like meta-scans that happen at first launch.
312+
# Packing too much work in at once is likely to lead to visible
313+
# stutters and ANR issues and whatnot.
303314
time_in_running_state = 0.0
304315
sleep_inc = 0.1
305-
while time_in_running_state < 3.0:
316+
while time_in_running_state < 10.0:
306317
time.sleep(sleep_inc)
307318
appstate = _babase.app.state
308319
appstate_t = type(appstate)

0 commit comments

Comments
 (0)