mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Revert part of 5810fd6 to fix perf regression
This brings the "rails, gitlabhq" benchmark test back to about 45 seconds on my machine, rather than over 10 minutes.
This commit is contained in:
committed by
Sashko Stubailo
parent
926cf1ca9d
commit
e9286de47d
@@ -1216,12 +1216,14 @@ var binaryWeightedSum = function (varsByWeight) {
|
||||
pushToNth(buckets, lowestWeight+1, carry);
|
||||
} else {
|
||||
// Whether we take variables from the start or end of the
|
||||
// bucket determines the shape of the tree. Taking them from
|
||||
// the beginning seems faster (one particular case took 10
|
||||
// seconds instead of 22 seconds).
|
||||
var a = bucket.shift();
|
||||
var b = bucket.shift();
|
||||
var c = bucket.shift();
|
||||
// bucket (i.e. `pop` or `shift`) determines the shape of the tree.
|
||||
// Empirically, some logic problems are faster with `shift` (2x or so),
|
||||
// but `pop` gives an order-of-magnitude speed-up on the Meteor Version
|
||||
// Solver "benchmark-tests" suite (Slava's benchmarks based on data from
|
||||
// Rails). So, `pop` it is.
|
||||
var c = bucket.pop();
|
||||
var b = bucket.pop();
|
||||
var a = bucket.pop();
|
||||
var sum = new Logic.FullAdderSum(a, b, c);
|
||||
var carry = new Logic.FullAdderCarry(a, b, c);
|
||||
bucket.push(sum);
|
||||
|
||||
Reference in New Issue
Block a user