The microbenchmark result for spawning short-lived concurrent process:
# Go 1.8.0
$ go build test.go ; for k in 5 50 500 5000 50000 500000; do echo -n $k; time ./test $k > /dev/null; done
5
CPU: 0.00s Real: 0.00s RAM: 2080KB
50
CPU: 0.06s Real: 0.01s RAM: 3048KB
500
CPU: 0.61s Real: 0.12s RAM: 7760KB
5K
CPU: 6.02s Real: 1.23s RAM: 17712KB # 17 MB
50K
CPU: 62.30s Real: 12.53s RAM: 207720KB # 207 MB
500K # this is 10x more!
CPU: 649.47s Real: 131.53s RAM: 3008180KB # 3 GB
# Elixir 1.4.2 (erts-8.2.2)
$ for k in 5 50 500 5000 50000 ; do echo -n $k; time elixir --erl "+P 90000000" test.exs $k > /dev/null; done
5
CPU: 0.53s Real: 0.50s RAM: 842384KB # 842 MB
50
CPU: 1.50s Real: 0.62s RAM: 934276KB # 934 MB
500
CPU: 11.92s Real: 2.53s RAM: 1675872KB # 1.6 GB
5K
CPU: 122.65s Real: 20.20s RAM: 4336116KB # 4.3 GB
50K
CPU: 1288.65s Real: 209.66s RAM: 6573560KB # 6.5 GB
You can find the code here. In terms of performance and memory usage, it's not really, but you can argue about anything else.
programming: the action or process of writing computer programs. | rants: speak or shout at length in a wild, [im]passioned way.
2017-11-07
2017-07-31
Tricks to be Motivated
Recently I being so much unmotivated with my work, and I think I know the reason, but anyway, these are the generic things to get things done:
- Buy a pen, and small notebook, seriously! Make a TODO list, break into very small things to be done in a day
- Have enough sugar and sleep, lack of sleep/concentration/focus is bad, as bad as alcohol addiction
- Do your tasks first before doing unimportant tasks (facebook, tweeting, watching movies, etc), make those unimportant things as reward
- Do not imagine yourself reaching the success, probably better imagining if you are fail and be afraid of it
- Your willpower is unlimited, and can be strengthened by doing more things that requires willpower, as willpower is contagious
- Surround yourself with people with same goals, or at least watch motivational people that work hard to reach their goals/dreams, be envious!
- Forgive yourself, guilt makes you want instant gratification that produces more guilt
- Do less decision, always go for option A, be courageous, set simple rules
- Walk/start first, motivation will comes later
I think that's it, these article summarized from videos about motivation and willpower I found on youtube.
2017-06-14
Cross Platform Game Development
So I was looking for cross-platform game development, found some that are good for Indie game dev development, such as V-Play that uses QML (I like Qt), but the review for the games it produced is quite bad (crashes a lot), so I look another one and found Cocos2D-JS (that has been merged to Cocos2D-X at 2016). To start the development, visit the download page, and choose the full one. Start any web server on that directory.
Need more resource? You can watch this awesome youtube playlist (2014 but still quite relevant), or see the website (warning: mostly broken link) or github for more reference.
Or you might want to try, comparison:
Need more resource? You can watch this awesome youtube playlist (2014 but still quite relevant), or see the website (warning: mostly broken link) or github for more reference.
Or you might want to try, comparison:
- Godot (GDScript like Python; Web, Android, iOS, Console, Desktop) wikipedia youtube
- MonkeyX (Monkey like Basic; Web, Android, iOS, Console)
- Love2D (Lua; Web, Android, iOS, Desktop)
- GDevelop (Web, Desktop)
- CoronaSDK (Lua; Android, iOS, Desktop) wikipedia
- MonoGame (.NET; Android, iOS, Desktop) wikipedia
- WaveEngine (.NET; Android, iOS, Desktop)
- Duality (.NET; Desktop)
- Loom SDK (.NET; Android, iOS, Desktop)
- Starling (AS; Web, Android, iOS, Desktop) wikipedia
- Cocos2D-x (Lua, Js; Android, iOS, Web, Desktop) wikipedia youtube
Actually I want to write this page as Cocos2D tutorial, but for my current project I need engine that can run under a WebView component, so here's the alternative:
- SuperPowers HTML5 (Js; Web, Android, iOS, Desktop) youtube youtube youtube
- Phaser.io (Js, Ts: Web, Cordova, NWJS) youtube youtube youtube youtube youtube youtube youtube youtube editor
- Panda.JS (Js; Web) youtube
- CraftyJS (Js; Web)
- PixiJS (Js; Web) youtube youtube youtube youtube
- MelonJS (Js; Web)
- KiwiJS (Js; Web) youtube
- QiCiEngine (Js; Web) youtube
- StageJS (Js; Web)
- EnchantJS (Js; Web) youtube tutorial
- LimeJS (Js; Web) youtube
2017-06-01
Alternatives for Web and Mobile App in single codebase
If you are a one-man-army.. um I mean full-stack dev, you'll need to reuse most code as much as possible, a single codebase for all platform instead of rewrite everything in programming language best suited for that platform, that is C++/Java for Android, Swift/Obj-C for iOS, and Javascript for Web.
Other than the popular ReactNative (with react-native-web) and NativeScript (with angular-part that can be reused), there are ReactXP (Microsoft), is a fork of ReactNative (Facebook), with some extras: TypeScript (future proposed ES7 with better tooling), single codebase for all common platform: Android, iOS, Web, and Windows.
To use them, you should clone their repository, and use the provided Hello World.
git clone https://github.com/microsoft/reactxp
cp -r reactxp/samples/hello-world rxp1
cd rxp1
npm install
npm run web-watch # or rn-watch for mobile
Open index.html using browser, preferably use a web server instead of file:// protocol. Install ReactDevTools for better debugging experience. The directories should show something like this:
├── android
│ ├── app
│ ├── build.gradle
│ ├── gradle
│ ├── gradle.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── keystores
│ └── settings.gradle
├── index.android.js
├── index.html # <-- the main code for web
├── index.ios.js
├── ios
│ ├── RXPHelloWorld
│ ├── RXPHelloWorldTests
│ └── RXPHelloWorld.xcodeproj
├── node_modules
├── package.json
├── README.md
├── src # <-- your common source code / components here
│ ├── App.tsx
│ ├── index.tsx
│ ├── ToggleSwitch.tsx
│ └── typings
├── tsconfig.json
└── webpack.config.ts
Other than the popular ReactNative (with react-native-web) and NativeScript (with angular-part that can be reused), there are ReactXP (Microsoft), is a fork of ReactNative (Facebook), with some extras: TypeScript (future proposed ES7 with better tooling), single codebase for all common platform: Android, iOS, Web, and Windows.
To use them, you should clone their repository, and use the provided Hello World.
git clone https://github.com/microsoft/reactxp
cp -r reactxp/samples/hello-world rxp1
cd rxp1
npm install
npm run web-watch # or rn-watch for mobile
Open index.html using browser, preferably use a web server instead of file:// protocol. Install ReactDevTools for better debugging experience. The directories should show something like this:
├── android
│ ├── app
│ ├── build.gradle
│ ├── gradle
│ ├── gradle.properties
│ ├── gradlew
│ ├── gradlew.bat
│ ├── keystores
│ └── settings.gradle
├── index.android.js
├── index.html # <-- the main code for web
├── index.ios.js
├── ios
│ ├── RXPHelloWorld
│ ├── RXPHelloWorldTests
│ └── RXPHelloWorld.xcodeproj
├── node_modules
├── package.json
├── README.md
├── src # <-- your common source code / components here
│ ├── App.tsx
│ ├── index.tsx
│ ├── ToggleSwitch.tsx
│ └── typings
├── tsconfig.json
└── webpack.config.ts
Now you can edit the App.tsx and start digging, but probably you'll need to wait around end of this year, until it has more features.
Next are the Cordova-based (that would be slower than native since it's browser based, also user on the older devices that has buggy 1 probably need to install last version of CrossWalk), there are:
Haven't tried them all, but..
Btw have you heard PWA (youtube)?
Note: this article written in 26th April 2017, scheduled to be published at 1st June 2017, probably things have change since then.
Also note that I didn't include other cross platform mobile-only development alternative or ones that specialized for gaming or must-pay, such as Xamarin/Unity3D, Cocos2D, RemObject's Silver, etc
Next are the Cordova-based (that would be slower than native since it's browser based, also user on the older devices that has buggy 1 probably need to install last version of CrossWalk), there are:
- the infmaous Ionic (the most mature of all, also support windows, electron-based and chrome-app) also it has paid drag-and-drop gui designer (Ionic Creator),
- Phonon (can be used with RiotJS),
- Quasar Framework (can be used with VueJS),
- Intel XDK,
- Framework7 (can be used with VueJS or React),
- OnsenUI (can be used with VueJS, React, Angular 1/2 or Meteor)
Haven't tried them all, but..
- by skimming the specs and the docs (that i prefer ones that not focusing on mobile-only),
- and since I dislike Angular (sorry Google),
- not really into React (and whatever state management libraries available: Flux, AltJS, Redux, MobX, Cerebral),
- prefer to use RiotJS > VueJS (since I think they take the good parts of Angular and React)
- not really like write in Typescript (but I like using libraries that written in Typescript ^^ because parameter info/object-property checking is quite helpful on development),
Btw have you heard PWA (youtube)?
Note: this article written in 26th April 2017, scheduled to be published at 1st June 2017, probably things have change since then.
Github Stat Apr 2017 | Watch | Star | Fork |
ReactNative | 2.9 | 47.5 | 11.0 |
Weex | 1.9 | 14.0 | 1.9 |
Ionic | 1.7 | 29.2 | 7.4 |
NativeScript | 0.6 | 10.0 | 0.7 |
Framework7 | 0.5 | 9.5 | 2.0 |
OnsenUI | 0.2 | 4.6 | 0.6 |
ReactXP | 0.2 | 4.4 | 0.2 |
IncubatorWeex | 0.1 | 2.2 | 0.3 |
Quasar | 0.1 | 1.9 | 0.1 |
Phonon | 0.0 | 0.3 | 0.0 |
React | 4.4 | 65.3 | 12.1 |
Angular | 4.4 | 55.5 | 27.7 |
Vue | 2.9 | 51.5 | 6.89 |
Riot | 0.4 | 11.8 | 0.9 |
Mithril | 0.3 | 7.5 | 0.6 |
Also note that I didn't include other cross platform mobile-only development alternative or ones that specialized for gaming or must-pay, such as Xamarin/Unity3D, Cocos2D, RemObject's Silver, etc
Labels:
cross-platform
,
framework7
,
intel-xdk
,
nativescript
,
onsenui
,
phonon
,
quasar-framework
,
reactnative
,
reactxp
,
weex
Subscribe to:
Posts
(
Atom
)