Commit b2bbdc6
committed
perf: replace Firefox 5s delay with readiness-based initialization
Instead of an arbitrary 5-second setTimeout for Firefox, this change
introduces a waitForReadiness() function that polls for actual
dependency readiness before initializing the app.
The new approach:
- Polls every animation frame for critical dependencies (createjs, Howler, jQuery)
- Checks for required DOM elements (canvas, loader, toolbars)
- Initializes as soon as ready (minimum 500ms for stability)
- Falls back to initialization after maximum 10s timeout
- Logs actual initialization time for debugging
Benefits:
- Fast Firefox machines: ~500-800ms instead of 5000ms
- Slow Firefox machines: waits appropriately up to 10s
- Provides insight via console logging
- Future-proof: adapts to actual dependencies
This addresses technical debt from 2015 when the arbitrary delay
was introduced as a workaround for Firefox hardware acceleration issues.1 parent da12f94 commit b2bbdc6
2 files changed
+91
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
| |||
1900 | 1901 | | |
1901 | 1902 | | |
1902 | 1903 | | |
1903 | | - | |
1904 | | - | |
1905 | | - | |
| 1904 | + | |
| 1905 | + | |
1906 | 1906 | | |
1907 | 1907 | | |
1908 | 1908 | | |
| |||
2221 | 2221 | | |
2222 | 2222 | | |
2223 | 2223 | | |
2224 | | - | |
2225 | | - | |
2226 | | - | |
| 2224 | + | |
| 2225 | + | |
2227 | 2226 | | |
2228 | 2227 | | |
2229 | 2228 | | |
| |||
4937 | 4936 | | |
4938 | 4937 | | |
4939 | 4938 | | |
4940 | | - | |
4941 | | - | |
4942 | | - | |
| 4939 | + | |
| 4940 | + | |
4943 | 4941 | | |
4944 | 4942 | | |
4945 | 4943 | | |
| |||
5007 | 5005 | | |
5008 | 5006 | | |
5009 | 5007 | | |
5010 | | - | |
5011 | | - | |
5012 | | - | |
| 5008 | + | |
| 5009 | + | |
5013 | 5010 | | |
5014 | 5011 | | |
5015 | 5012 | | |
| |||
5859 | 5856 | | |
5860 | 5857 | | |
5861 | 5858 | | |
5862 | | - | |
5863 | | - | |
| 5859 | + | |
| 5860 | + | |
5864 | 5861 | | |
5865 | 5862 | | |
5866 | 5863 | | |
| |||
7692 | 7689 | | |
7693 | 7690 | | |
7694 | 7691 | | |
7695 | | - | |
7696 | | - | |
7697 | | - | |
7698 | | - | |
7699 | | - | |
7700 | | - | |
| 7692 | + | |
| 7693 | + | |
7701 | 7694 | | |
7702 | 7695 | | |
| 7696 | + | |
| 7697 | + | |
| 7698 | + | |
| 7699 | + | |
| 7700 | + | |
| 7701 | + | |
| 7702 | + | |
| 7703 | + | |
| 7704 | + | |
| 7705 | + | |
| 7706 | + | |
| 7707 | + | |
| 7708 | + | |
| 7709 | + | |
7703 | 7710 | | |
7704 | 7711 | | |
7705 | 7712 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
343 | 343 | | |
344 | 344 | | |
345 | 345 | | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
346 | 408 | | |
347 | 409 | | |
348 | 410 | | |
| |||
0 commit comments