3 ms·
Spoken like someone who has never tried to optimize startup time. If network is your blocker, you need to do it as soon as possible
by vvG94KbDUtRa 6y ago
Spoken like someone who has never tried to optimize startup time. If network is your blocker, you need to do it as soon as possible
- saagarjha 6y agoPutting more code in a constructor is almost never advised. I would expect that whatever connection the Facebook SDK is making is not a blocker for application launch. (If you have more insight on why this code must unconditionally run this early, I would be glad to hear it.)
- jfkebwjsbx 6y agoRunning code before main has nothing to do with performance.
- unilynx 6y agoIt surely does, performance is more about just raw CPU. Prefetching data (even a DNS query) reduces the latency the user perceives. The web similarly added the various <link rel=preload, dns-prefetch> tags, so things can be connected and fetched before the JS/CSS code is ready
- munchbunny 6y agoThe gain from trying to eke out a millisecond by executing network or filesystem I/O code before main() is extremely marginal compared to the can of worms opened by doing that.