[ https://issues.apache.org/jira/browse/MAHOUT-300?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12836649#action_12836649 ]
Robin Anil commented on MAHOUT-300: ----------------------------------- On dense data 1000, 1000 {noformat} BenchMarks DenseVector RandSparseVector SeqSparseVector Dense.dot(Rand) Dense.dot(Seq) Rand.dot(Dense) Rand.dot(Seq) Seq.dot(Dense) Seq.dot(Rand) DotProduct nCalls = 20000; nCalls = 20000; nCalls = 20000; nCalls = 20000; nCalls = 20000; nCalls = 20000; nCalls = 20000; nCalls = 20000; nCalls = 20000; sum = 0.042869s; sum = 1.139837s; sum = 0.293336s; sum = 0.882977s; sum = 0.452817s; sum = 1.330815s; sum = 0.843993s; sum = 0.931822s; sum = 1.093099s; min = 0.0010ms; min = 0.046ms; min = 0.01ms; min = 0.03ms; min = 0.011ms; min = 0.049ms; min = 0.027ms; min = 0.036ms; min = 0.049ms; max = 2.717ms; max = 21.51ms; max = 3.156ms; max = 25.346ms; max = 26.567ms; max = 14.738ms; max = 53.265ms; max = 9.44ms; max = 4.017ms; mean = 0.002143ms; mean = 0.056991ms; mean = 0.014666ms; mean = 0.044148ms; mean = 0.02264ms; mean = 0.06654ms; mean = 0.042199ms; mean = 0.046591ms; mean = 0.054654ms; stdDev = 0.027798ms; stdDev = 0.194404ms; stdDev = 0.053138ms; stdDev = 0.30642ms; stdDev = 0.255753ms; stdDev = 0.212913ms; stdDev = 0.446643ms; stdDev = 0.131948ms; stdDev = 0.054681ms; Speed = 466537.6 /sec Speed = 17546.367 /sec Speed = 68181.195 /sec Speed = 22650.646 /sec Speed = 44167.953 /sec Speed = 15028.385 /sec Speed = 23696.877 /sec Speed = 21463.326 /sec Speed = 18296.604 /sec Rate = 5598.451 MB/s Rate = 210.55641 MB/s Rate = 818.17444 MB/s Rate = 271.80777 MB/s Rate = 530.01544 MB/s Rate = 180.34062 MB/s Rate = 284.36255 MB/s Rate = 257.55994 MB/s Rate = 219.55927 MB/s {noformat} On Sparse Data (1000, 300) Dont compare the MB/s see the unit/s {noformat} BenchMarks DenseVector RandSparseVector SeqSparseVector Dense.dot(Rand) Dense.dot(Seq) Rand.dot(Dense) Rand.dot(Seq) Seq.dot(Dense) Seq.dot(Rand) DotProduct nCalls = 20000; nCalls = 20000; nCalls = 20000; nCalls = 20000; nCalls = 20000; nCalls = 20000; nCalls = 20000; nCalls = 20000; nCalls = 20000; sum = 0.048355s; sum = 0.569326s; sum = 0.338478s; sum = 0.408213s; sum = 0.205143s; sum = 0.469473s; sum = 0.242953s; sum = 0.291587s; sum = 0.362947s; min = 0.0010ms; min = 0.018ms; min = 0.011ms; min = 0.012ms; min = 0.0040ms; min = 0.017ms; min = 0.01ms; min = 0.011ms; min = 0.014ms; max = 6.525ms; max = 33.768ms; max = 3.936ms; max = 26.649ms; max = 27.028ms; max = 3.969ms; max = 3.042ms; max = 4.704ms; max = 7.04ms; mean = 0.002417ms; mean = 0.028466ms; mean = 0.016923ms; mean = 0.02041ms; mean = 0.010257ms; mean = 0.023473ms; mean = 0.012147ms; mean = 0.014579ms; mean = 0.018147ms; stdDev = 0.062427ms; stdDev = 0.302488ms; stdDev = 0.059426ms; stdDev = 0.237577ms; stdDev = 0.222142ms; stdDev = 0.05819ms; stdDev = 0.026846ms; stdDev = 0.06257ms; stdDev = 0.06777ms; Speed = 413607.7 /sec Speed = 35129.258 /sec Speed = 59088.03 /sec Speed = 48994.03 /sec Speed = 97492.96 /sec Speed = 42600.957 /sec Speed = 82320.45 /sec Speed = 68590.164 /sec Speed = 55104.46 /sec Rate = 1488.9877 MB/s Rate = 126.46532 MB/s Rate = 212.7169 MB/s Rate = 176.3785 MB/s Rate = 350.97464 MB/s Rate = 153.36345 MB/s Rate = 296.3536 MB/s Rate = 246.92456 MB/s Rate = 198.37605 MB/s {noformat} > Solve performance issues with Vector Implementations > ---------------------------------------------------- > > Key: MAHOUT-300 > URL: https://issues.apache.org/jira/browse/MAHOUT-300 > Project: Mahout > Issue Type: Improvement > Affects Versions: 0.3 > Reporter: Robin Anil > Fix For: 0.3 > > Attachments: MAHOUT-300.patch, MAHOUT-300.patch, MAHOUT-300.patch, > MAHOUT-300.patch, MAHOUT-300.patch, MAHOUT-300.patch > > > AbstractVector operations like times > public Vector times(double x) { > Vector result = clone(); > Iterator<Element> iter = iterateNonZero(); > while (iter.hasNext()) { > Element element = iter.next(); > int index = element.index(); > result.setQuick(index, element.get() * x); > } > return result; > } > should be implemented as follows > public Vector times(double x) { > Vector result = clone(); > Iterator<Element> iter = result.iterateNonZero(); > while (iter.hasNext()) { > Element element = iter.next(); > element.set(element.get() * x); > } > return result; > } -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.