<< Back to previous view

[CRRBV-4] Seq has broken support for reducers Created: 11/Mar/14  Updated: 25/Jun/14  Resolved: 28/Mar/14

Status: Closed
Project: core.rrb-vector
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Jozef Wagner Assignee: Michał Marczyk
Resolution: Completed Votes: 0
Labels: None


 Description   

RRB-T Vector uses existing VecSeq for seqs created from it. However, internal reduce in VecSeq is fixed at 32 elements per array, and this cause skipping when RRB-T Vector has different array sized.

user=> (require 'clojure.core.rrb-vector)
nil
user=> (def v1 (clojure.core.rrb-vector/subvec (clojure.core/vec (clojure.core/range 1003)) 500))
#'user/v1
user=> (def v2 (clojure.core/range 500 1003))
#'user/v2
user=> (= v1 v2)
true
user=> (reduce + 0 v1)
377753
user=> (reduce + 0 v2)
377753
user=> (reduce + 0 (clojure.core.reducers/map identity (seq v1)))
366786
user=> (reduce + 0 (clojure.core.reducers/map identity (seq v2)))
377753


 Comments   
Comment by Michał Marczyk [ 28/Mar/14 8:12 PM ]

Fixed as of this commit:

https://github.com/clojure/core.rrb-vector/commit/d8941e8b064bebe2b0f13535d39faeb3341d6459

Thanks for the report!

Generated at Fri Sep 19 15:08:42 CDT 2014 using JIRA 4.4#649-r158309.