goete111 / factorie

Automatically exported from code.google.com/p/factorie
0 stars 0 forks source link

Sampling from variable domains is slow #14

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Calling something like Domain[Token].sample is extremely slow (where Token
in this case is an EnumVariable) compared to calling myArrayBuffer.sample.
Do domains allow for random access? Would this fix the problem?

Original issue reported on code.google.com by thebiasedestimator@gmail.com on 14 Apr 2010 at 2:37

GoogleCodeExporter commented 8 years ago
Karl and I spent some time on this. Upon inspection the implicit sample method 
calls
 .toSeq, which means that if the Domain is not a Seq then the entire domain will be
converted to a sequence before sampling it. We'll investigate further and 
report back.

Original comment by thebiasedestimator@gmail.com on 14 Apr 2010 at 4:10