「これより速いのがあったら言ってこい」Google非公式DIフレームワーク Tiger 登場!!

Google製のライブラリが集まっていいるGitHubリポジトリがありますが.

Google

Google

DIフレームワークが新しく登場しています.

google_tiger

google/tiger

DISCLAIMER: This is not an official Google product. Google's production dependency injection frameworks are Dagger and Guice.

Dagger や Guice があるので, このフレームワークは「非公式」ということですが, 速さの面で気持ちいい啖呵を切っているようにも見えます.

Challenge

If one found a DI framework faster, let me know. I will drop the title as long as it is proved.

「これより速いの見つけたら教えてね♥」

Group

[email protected]

と, メールアドレスもこだわっています.

サンプルを見た感じアノテーションを利用した Dagger とよく似た雰囲気になっておりますが, それぞれのスコープに対してひとつのインジェクターを生成するしくみのようです.


public class PseudoActivity {
  @Inject
  Foo foo;

  @Inject
  @BarAnnotation
  Bar bar;

  @Inject
  @BarAnnotation
  Bar bar2;

  @Inject
  Baz baz;
  
  @Inject
  Shboom shboom;

  void onCreate(DaggerApplicationComponent applicationComponent) {
    DaggerActivityComponent activityComponent =
        new DaggerActivityComponent.Builder().daggerApplicationComponent(applicationComponent).build();
    activityComponent.injectPseudoActivity(this);
  }

  @Override
  public String toString() {
    return "PseudoActivity[foo: " + foo + ", bar: " + bar + " bar2: " + bar2 + ", baz: " + baz
        + " shboom: " + shboom + "]";
  }
}

こんなかんじで最近はGoogleから実験的なライブラリが公開されるようになってきていますが, どれも微妙な雰囲気はあります.

Include the "not an official Google product" disclaimer by gk5885 · Pull Request #3 · google/tiger

これ, 今後どうなっていくのでしょうかー.

Google発リアクティブなライブラリ「Agera」の評判を眺める


「Amazon Vehicles」で車でもポチる?

こゆのあったんだわ!

Amazon.com: : Vehicles

Amazon_com____Vehicles

オプションの選択とかの金額とか店舗で話してもなんかめんどくさいすよね.

とうぜんWEBなら計算できたり画像で確認できたり.

Amazon_com__2015_Toyota_Corolla_L__4-Door_Sedan_Automatic_Transmission__GS___Black_Sand_Mica__Vehicles 2

Amazon_com__2015_Toyota_Corolla_L__4-Door_Sedan_Automatic_Transmission__GS___Black_Sand_Mica__Vehicles

試乗しないのであれば, Amazonで買ってもいいように思ったり.


75%速度向上という Gradle 3.0 を Android Studio で試す

更新されてます, Gradle が 3.0 に.

Gradle_3_0_released_-_News_-_Gradle_Forums

Gradle 3.0 released - News - Gradle Forums

Gradle_Distributions

Gradle Distributions

The Gradle Daemon is a key performance enhancer, making builds up to 75% faster, but it needed to be explicitly enabled in previous versions of Gradle. This is no longer necessary as the Daemon is now enabled by default in 3.0.

Daemon がデフォルトで起動され, 75% の速度向上らしいので.

 

Android Studio で使ってみよう

プロジェクトルートの位置で.

./gradlew wrapper --gradle-version=3.0

これで, Gradle 側はラッパーインストールできますが, Android Plugin が 2.1.x系では対応できていないようです.

最新のbetaを入れてみましょう.

com_android_tools_build_gradle

com.android.tools.build.gradle

(project-root)/build.gradle


buildscript {
  //System.properties['com.android.build.gradle.overrideVersionCheck'] = 'true'
  repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0-beta1'
    }
}

Total time: 6.543 secs

Total time: 1.472 secs

小さいプロジェクトでも, 2回目以降のビルドで, 高速になったことが体感できます.

まあ, beta ということで少し待っていたほうがいいのかも知れませんが.

Latest Bugs topics - Gradle Forums

Android お手軽なビルド時間の短縮メモ