twitter / cassovary

Cassovary is a simple big graph processing library for the JVM
http://twitter.com/cassovary
Apache License 2.0
1.05k stars 150 forks source link

Convert Node.inboundNodes() and outboundNodes() to have Array[Int] instead of Seq[Int] #200

Closed pankajgupta closed 8 years ago

pankajgupta commented 9 years ago

I think @szymonm you had pointed this out with some benchmarking data as well? If so, can you please link to a gist if possible. I am finally coming around to agreeing that this should indeed be done as the current code does un-necessary boxing/unboxing.

szymonm commented 9 years ago

What could be event better is to have our own Seq (backed by Array) that is specialized.

I benchmarked only some Map based boxing.

On Tue, 8 Sep 2015 at 07:11 Pankaj Gupta notifications@github.com wrote:

I think @szymonm https://github.com/szymonm you had pointed this out with some benchmarking data as well? If so, can you please link to a gist if possible. I am finally coming around to agreeing that this should indeed be done as the current code does un-necessary boxing/unboxing.

— Reply to this email directly or view it on GitHub https://github.com/twitter/cassovary/issues/200.

pankajgupta commented 9 years ago

So something like class MySeq[@specialized(Int) T] { ... }

what are the reasons using this would that be better than plain Array?

szymonm commented 9 years ago

If we implement get(n: Int): Int in MySeq returned int will not be boxed. And all the other methods we implement in Seq.

On Wed, 9 Sep 2015 at 06:47 Pankaj Gupta notifications@github.com wrote:

So something like class MySeq[@specialized https://github.com/specialized(Int) T] { ... }

what are the reasons using this would that be better than plain Array?

— Reply to this email directly or view it on GitHub https://github.com/twitter/cassovary/issues/200#issuecomment-138778459.

pankajgupta commented 9 years ago

So will in an array?

szymonm commented 9 years ago

That's true. But I was thinking that MySeq could have API that is a subset of scala.Seq (inluding map function for instance), so that we can eventually change it to scala.Seq, when Scala solves boxing/unboxing problems.

On Wed, 9 Sep 2015 at 09:00 Pankaj Gupta notifications@github.com wrote:

So will in an array?

— Reply to this email directly or view it on GitHub https://github.com/twitter/cassovary/issues/200#issuecomment-138807893.

pankajgupta commented 8 years ago

Hey @szymonm -- just wondering if you are working on this?

szymonm commented 8 years ago

Yes, I am. Trying to finish CMap right now and then CSeq...

On Fri, 30 Oct 2015 at 18:09 Pankaj Gupta notifications@github.com wrote:

Hey @szymonm https://github.com/szymonm -- just wondering if you are working on this?

— Reply to this email directly or view it on GitHub https://github.com/twitter/cassovary/issues/200#issuecomment-152588989.