Bug #1442
openAll the tools should auto sent to visualization
Description
once press run, any tool has feature to send to Viz should sending the updated data...
Files
Updated by ALi RAZA 5 days ago
· Edited
- File Prism-Attachment.mp4 Prism-Attachment.mp4 added
- Status changed from New to Resolved
- % Done changed from 0 to 100
Enhancing Dashboard Accuracy and Performance (Stale Chart Data Fix)
What we fixed: We resolved an issue where our dashboard charts were occasionally showing "stale" or old data. Previously, if a user updated values in their dataset via the analytics section, the table view would update correctly, but the charts would stay stuck showing the old incorrect values.
Why it was happening: To keep the dashboard fast for massive datasets, our system was trying to be "smart" by saving previously calculated charts in its memory (caching). To know if it needed to recalculate a chart, it was opening the dataset, peeking at a small sample of the top and bottom rows, and guessing if the data had changed.
The flaw here was that if a user changed values hidden in the middle of the dataset, or if they changed values without changing the total number of rows, the system's "sample check" often got tricked. It assumed nothing had changed and displayed the old chart from memory.
There is one more solution that we can check our whole data, but Checking every row or field (deep comparison) would be incredibly slow. If you had 100,000 rows, scanning every field to see if it changed would freeze the browser.
Instead, we use a trick called Reference Equality Checking (Memory Pointer check). Here is how it works:
How we solved it (The "New Box" Strategy (Immutability)): We completely rebuilt how the dashboard detects data updates by utilizing the "New Box" strategy.
Think of a dataset being delivered to the dashboard inside a sealed shipping box.
- The Old Way: The system would slice the box open, peek at the top 3 items, guess if the contents had changed, and try to reuse old charts to save time.
- The New Way: Because of how modern platforms handle data, any time a user makes even a tiny edit, the platform automatically packs the updated data into a brand new box with a new shipping label. Our updated system no longer wastes time trying to peek inside the box. Instead, it just looks at the shipping label. If a new box arrives, it instantly says, "New data is here!" It throws away all the old charts in its memory and redraws them perfectly accurately.
What this means for our users:
- 100% Accuracy Guaranteed: The dashboard will never be tricked into showing stale data again. The charts and the data tables will always stay perfectly in sync.
- Lightning Fast Performance: Because the system no longer wastes time "peeking inside" and scanning massive datasets row-by-row, but simply checks for a "new box," the dashboard remains incredibly fast and will not freeze, even when analyzing millions of rows.
Additional Information:
The "box" isn't a special tool we built. It’s just how Javascript works! Every time data crosses the network from the backend to the frontend, JavaScript automatically creates a brand new block of memory (a new box) for it. We are just using a super-fast math trick (===) to check if the memory blocks are different!