Commit 9048a4f
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 d3feb90 commit 9048a4f
2 files changed
+84
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
7675 | 7675 | | |
7676 | 7676 | | |
7677 | 7677 | | |
7678 | | - | |
| 7678 | + | |
| 7679 | + | |
| 7680 | + | |
| 7681 | + | |
| 7682 | + | |
| 7683 | + | |
| 7684 | + | |
| 7685 | + | |
| 7686 | + | |
| 7687 | + | |
| 7688 | + | |
| 7689 | + | |
| 7690 | + | |
| 7691 | + | |
| 7692 | + | |
| 7693 | + | |
| 7694 | + | |
| 7695 | + | |
7679 | 7696 | | |
7680 | 7697 | | |
7681 | 7698 | | |
| |||
| 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 | | |
| |||
562 | 624 | | |
563 | 625 | | |
564 | 626 | | |
565 | | - | |
| 627 | + | |
566 | 628 | | |
567 | 629 | | |
568 | 630 | | |
569 | 631 | | |
570 | | - | |
| 632 | + | |
571 | 633 | | |
572 | 634 | | |
573 | 635 | | |
| |||
0 commit comments