タグ

streamに関するellerのブックマーク (3)

  • Java8 Stream APIの基本(4) - ストリームの内部 - エンタープライズギークス (Enterprise Geeks)

    先日の記事ではStreamの基的な生成処理について述べた。 今回はStreamの内部処理で扱われるSpliteratorについて解説する。 Spliterator Spliteratorは分割可能なイテレータであり、Streamの低レベルAPI用のインターフェースである(名前の由来はsplititeretorの合成と思われる)。コレクションの繰り返しにはIteratorが使われるように、Streamの要素の走査は内部的にSpliteratorを用いている。 Spliteratorには 要素を2つに分割する trySplitメソッドがあり、並列ストリームで各スレッドに要素を分割する方法として使用されている。 また中間・終端走査や、並列処理を効率化するヒントとして、characteristics(性質)、 estimateSize(サイズ)等の属性を持つ(characteristicsにつ

    Java8 Stream APIの基本(4) - ストリームの内部 - エンタープライズギークス (Enterprise Geeks)
    eller
    eller 2015/08/25
    Spliteratorについてブログ書こうかと思ったらとてもよい記事が見つかった。ウルシステムズさんすげーな。
  • JavaのStreamで末尾再帰 - Kengo's blog

    JavaのStreamで末尾再帰するというアイデアが今読んでるFunctional Programming in Javaで紹介されていた。 The Pragmatic Bookshelf | Functional Programming in Java agiledeveloper: Functional Programming in Java is quite Approachable 動かしてみたら、確かにStacktraceが浅いままで階乗の計算ができている。 タネはStream.iterate()で、このメソッドが再帰の代わりに必要なメソッドの計算を行ってくれている。試していないがStream.generate()でも同じことができるのではないだろうか。 あまり直感的ではないが、実用的なテクニックではありそう。覚えておこう。 追記 マイクロベンチの結果、やはり素直な書き方よりは遅

    JavaのStreamで末尾再帰 - Kengo's blog
    eller
    eller 2015/06/12
    書きました。競技プログラミングはもちろん、一部業務でも有効かもしれません。
  • Storm Anatomy

    2. About Me Eiichiro Uchiumi • A solutions architect at working in emerging enterprise technologies - Cloud transformation - Enterprise mobility - Information optimization (big data) https://github.com/eiichiro @eiichirouchiumi http://www.facebook.com/ eiichiro.uchiumi 3. What is Stream Processing? Stream processing is a technical paradigm to process big volume unbound sequence of tuples in realti

    Storm Anatomy
  • 1