You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The largest performance improvement (which is getting the /Large example to work) is to the shareStrings from an Array to a Map (=object).
The function addStringCol does a lookup in shareStrings to see, whether the value is already registered as a shared string. In the example this lookup always fails (because it writes GUIDs) and hence is always looping over the entire array. A map lookup (shareStrings[value] === undefined) changes this lookup from an order n orperation to an log(n) operation. Since addStringCol is called for each string, the total execution time performs like O(n^2). With the map, it reduces to O(n log(n)).
Obviously, you have to count your sharedStrings manually. But the change is minimal, the result is huge. See attached file for the changes (marked by CHANGE START ... CHANGE END). index.zip
No description provided.
The text was updated successfully, but these errors were encountered: