yarn start twice as fast
Summary: Compilation is a mixture of I/O and CPU work, so there's some good optimisation potential even on a single thread by running the promises concurrently. The downside is that the output is a bit garbled, but it's quite a bit faster for me. To test this, I applied this diff so I could just `time yarn start` for an entire run. ``` diff --git a/xplat/sonar/src/init.js b/xplat/sonar/src/init.js --- a/xplat/sonar/src/init.js +++ b/xplat/sonar/src/init.js @@ -80,4 +80,5 @@ dispatcher(store, logger); // make init function callable from outside window.Flipper.init = init; + window.close(); }); ``` ## Before **Cold Start** ``` 696.89user 93.21system 4:21.44elapsed 302%CPU (0avgtext+0avgdata 1111448maxresident)k 1416inputs+372824outputs (3major+28155897minor)pagefaults 0swaps ``` **Hot Start** ``` 6.87user 1.62system 0:17.32elapsed 49%CPU (0avgtext+0avgdata 249264maxresident)k 216inputs+182912outputs (0major+251426minor)pagefaults 0swaps ``` ## After **Cold Start** ``` 736.86user 95.47system 1:53.13elapsed 735%CPU (0avgtext+0avgdata 970616maxresident)k 42864inputs+356776outputs (42major+25299531minor)pagefaults 0swaps ``` **Hot Start** ``` 6.85user 1.60system 0:15.93elapsed 53%CPU (0avgtext+0avgdata 269420maxresident)k 2592inputs+197904outputs (0major+260099minor)pagefaults 0swaps ``` ## Summary It's beneficial in both cases, but the wall clock time for cold start goes from *4:21.44* to *1:53.13* for me (mind that this is a single sample). This is a 2.3x speed-up! Reviewed By: jknoxville Differential Revision: D16359215 fbshipit-source-id: 62257ec3bdefbf98356f5ac9418c4906f7cb4b1b
Flipper

Flipper (formerly Sonar) is a platform for debugging mobile apps on iOS and Android. Visualize, inspect, and control your apps from a simple desktop interface. Use Flipper as is or extend it using the plugin API.
Table of Contents
- Mobile development
- Extending Flipper
- Contributing to Flipper
- In this repo
- Getting started
- Building from Source
Mobile development
Flipper aims to be your number one companion for mobile app development on iOS and Android. Therefore, we provide a bunch of useful tools including a log viewer, interactive layout inspector, and network inspector.
Extending Flipper
Flipper is built as a platform. In addition to using the tools already included, you can create your own plugins to visualize and debug data from your mobile apps. Flipper takes care of sending data back and forth, calling functions, and listening for events on the mobile app.
Contributing to Flipper
Both Flipper's desktop app and native mobile SDKs are open-source and MIT licensed. This enables you to see and understand how we are building plugins, and of course join the community and help improve Flipper. We are excited to see what you will build on this platform.
In this repo
This repository includes all parts of Flipper. This includes:
- Flipper's desktop app built using Electron (
/src) - native Flipper SDKs for iOS (
/iOS) - native Flipper SDKs for Android (
/android) - Plugins:
- Logs (
/src/device-plugins/logs) - Layout inspector (
/src/plugins/layout) - Network inspector (
/src/plugins/network) - Shared Preferences/NSUserDefaults inspector (
/src/plugins/shared_preferences)
- Logs (
- website and documentation (
/website//docs)
Getting started
Please refer to our Getting Started guide to set up Flipper.
Requirements
- macOS (Flipper works on Linux and Windows, too, but we only support macOS officially at the moment.)
- node >= 8
- yarn >= 1.5
- iOS developer tools (for developing iOS plugins)
- Android SDK and adb
Building from Source
Desktop
Running from source
git clone https://github.com/facebook/flipper.git
cd flipper
yarn
yarn start
NOTE: If you're on Windows, you need to use Yarn 1.5.1 until this issue is resolved.
Building standalone application
yarn build --mac --version $buildNumber
iOS SDK + Sample App
cd iOS/Sample
rm -f Podfile.lock
pod install --repo-update
open Sample.xcworkspace
<Run app from xcode>
You can omit --repo-update to speed up the installation, but watch out as you may be building against outdated dependencies.
Android SDK + Sample app
Start up an android emulator and run the following in the project root:
./gradlew :sample:installDebug
Documentation
Find the full documentation for this project at fbflipper.com.
Our documentation is built with Docusaurus. You can build it locally by running this:
cd website
yarn
yarn start
Contributing
See the CONTRIBUTING file for how to help out.
License
Flipper is MIT licensed, as found in the LICENSE file.
