You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by sh...@apache.org on 2021/07/09 16:02:16 UTC

[echarts] branch dataset-perf updated (deafca7 -> ed75a2e)

This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a change to branch dataset-perf
in repository https://gitbox.apache.org/repos/asf/echarts.git.


    from deafca7  refact(data): fix some typo bugs
     new 973b70d  refact(data): fix downsample
     new ed75a2e  refact(data): indices should not keep after clone

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/data/DataStorage.ts | 21 ++++++++++-----------
 src/data/SeriesData.ts  |  3 ++-
 2 files changed, 12 insertions(+), 12 deletions(-)

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[echarts] 02/02: refact(data): indices should not keep after clone

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch dataset-perf
in repository https://gitbox.apache.org/repos/asf/echarts.git

commit ed75a2e7fc723e1392955ed37553206109212bd9
Author: pissang <bm...@gmail.com>
AuthorDate: Sat Jul 10 00:01:15 2021 +0800

    refact(data): indices should not keep after clone
---
 src/data/DataStorage.ts | 16 +++++++---------
 src/data/SeriesData.ts  |  3 ++-
 2 files changed, 9 insertions(+), 10 deletions(-)

diff --git a/src/data/DataStorage.ts b/src/data/DataStorage.ts
index 85a1b85..36a615b 100644
--- a/src/data/DataStorage.ts
+++ b/src/data/DataStorage.ts
@@ -686,13 +686,9 @@ class DataStorage {
       */
      map(dims: DimensionIndex[], cb: MapCb): DataStorage {
         // TODO only clone picked chunks.
-         const target = this.clone(dims);
+         const target = this.clone(dims, true);
          const targetChunks = target._chunks;
 
-         // Following properties are all immutable.
-         // So we can reference to the same value
-         target._indices = this._indices;
-         target.getRawIndex = this.getRawIndex;
 
          const tmpRetValue = [];
          const dimSize = dims.length;
@@ -1001,7 +997,7 @@ class DataStorage {
       *
       * @param clonedDims Determine which dims to clone. Will share the data if not specified.
       */
-     clone(clonedDims?: number[]): DataStorage {
+     clone(clonedDims?: number[], cloneIndices?: boolean): DataStorage {
         const target = new DataStorage();
         const chunks = this._chunks;
         const clonedDimsMap = clonedDims && reduce(clonedDims, (obj, dimIdx) => {
@@ -1020,6 +1016,11 @@ class DataStorage {
             target._chunks = chunks;
         }
         this._copyCommonProps(target);
+
+        if (cloneIndices) {
+            target._indices = this._cloneIndices();
+        }
+        target._updateGetRawIdx();
         return target;
      }
 
@@ -1051,9 +1052,6 @@ class DataStorage {
 
         target._extent = clone(this._extent);
         target._rawExtent = clone(this._rawExtent);
-        target._indices = this._cloneIndices();
-
-        target._updateGetRawIdx();
      }
 
      private _cloneIndices() {
diff --git a/src/data/SeriesData.ts b/src/data/SeriesData.ts
index 553a225..a97cd68 100644
--- a/src/data/SeriesData.ts
+++ b/src/data/SeriesData.ts
@@ -82,7 +82,7 @@ type MapCb<Ctx> = (this: CtxOrList<Ctx>, ...args: any) => ParsedValue | ParsedVa
 
 const TRANSFERABLE_PROPERTIES = [
     'hasItemOption', '_nameList', '_idList', '_invertedIndicesMap',
-    '_rawData', '_dimValueGetter', '_store',
+    '_rawData', '_dimValueGetter',
     '_nameDimIdx', '_idDimIdx', '_nameRepeatCount'
 ];
 const CLONE_PROPERTIES = [
@@ -1155,6 +1155,7 @@ class SeriesData<
         }
 
         transferProperties(list, this);
+        list._store = this._store.clone();
 
         return list;
     }

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


[echarts] 01/02: refact(data): fix downsample

Posted by sh...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

shenyi pushed a commit to branch dataset-perf
in repository https://gitbox.apache.org/repos/asf/echarts.git

commit 973b70d8fc07c00a29b5b5c5c1eef506c0be31ec
Author: pissang <bm...@gmail.com>
AuthorDate: Fri Jul 9 23:50:02 2021 +0800

    refact(data): fix downsample
---
 src/data/DataStorage.ts | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/data/DataStorage.ts b/src/data/DataStorage.ts
index e95f9e0..85a1b85 100644
--- a/src/data/DataStorage.ts
+++ b/src/data/DataStorage.ts
@@ -844,7 +844,7 @@ class DataStorage {
         const len = this.count();
         const rawExtentOnDim = target._rawExtent[dimension];
 
-        const newIndices = new (getIndicesCtor(this._rawCount))(len);
+        const newIndices = new (getIndicesCtor(this._rawCount))(Math.ceil(len / frameSize));
 
         let offset = 0;
         for (let i = 0; i < len; i += frameSize) {
@@ -875,8 +875,9 @@ class DataStorage {
         }
 
         target._count = offset;
+        target._indices = newIndices;
 
-        this._updateGetRawIdx();
+        target._updateGetRawIdx();
 
         return target;
     }

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org