Blocking Main Thread Issue with Large Datasets in WebDataRocks Configuration

My Vue 3 project is utilizing WebDataRocks to manage large datasets. While the implementation works well with smaller datasets, it faces performance issues as the data size grows due to the setReport method blocking the main thread. Below is a simplified version of my code:

<template>
  <div>
    <webdatarocks ref="pivot"></webdatarocks>
  </div>
</template>

<script>
import WebDataRocks from "webdatarocks";

export default {
  props: {
    dataSource: {
      type: Array,
      required: true,
    },
  },
  mounted() {
    this.$refs.pivot.webdatarocks.on("reportcomplete", () => {
      this.$refs.pivot.webdatarocks.off("reportcomplete");
      this.$refs.pivot.webdatarocks.setReport(this.report);
    });
  },
  watch: {
    dataSource: {
      handler(newValue) {
        this.setReport();
      },
      deep: true,
    },
  },
  methods: {
    setReport() {
      const report = {
        dataSource: {
          data: this.dataSource,
        },
      };
      this.$refs.pivot.webdatarocks.setReport(report);
    },
  },
};
</script>

Query: How can I address the main thread blocking issue caused by setReport when handling large datasets? Are there any best practices or alternative methods recommended for efficiently managing large datasets in WebDataRocks? Additional Details: Vue.js version: 3.x WebDataRocks version: latest release Operating System: Windows 10 Browser: latest version

I experimented with the following solution to tackle the main thread blocking problem:

import { debounce } from 'lodash';

methods: {
  setReport: debounce(function () {
    const report = {
      dataSource: {
        data: this.dataSource,
      },
    };
    this.$refs.pivot.webdatarocks.setReport(report);
  }, 300),
},

Answer №1

According to information provided on the DataAnalyzer platform, it is noted that the data capacity of the tool is limited to 1 MB. In theory, this volume of data should not lead to any performance obstacles. However, in scenarios where the Vue watcher receives numerous simultaneous updates or executes recursive operations, there is a risk of the page freezing as a result of multiple setReport calls. To investigate this issue, consider inserting debug statements within the methods.setReport function. If this situation arises, options include addressing any recursive calls or decreasing the frequency at which the report is reset.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Searching for a directive's data within a controller: Tips for updating it efficiently

I'm just starting out with AngularJS and struggling to find the answer to my question. I really want to refactor my app in an MVC way before it turns into a tangled mess :) Currently, I have a directive that shows the number of users in groups who ar ...

What is the maximum depth allowed in Vue?

My Vue component has the following structure: <transition name="fade"> <div> <div v-if="false"> </div> <div v-else=""> <div> <div> <div>no matter what content</div> ...

Is there a way to import TypeScript modules from node_modules using browserify?

After successfully running tsc, I am facing difficulty understanding how to import TypeScript modules from node modules. The crucial section of my gulp file is as follows: gulp.task('compile-ts', ['clean'], function(){ var sourceTsF ...

Verify the accurate sequence for arranging the items in the drag and drop list

I am currently developing a Language learning platform that includes several web applications. I am still new to javascript and struggling to find a solution for one of my apps. This specific app involves draggable list items that need to be arranged in t ...

JavaScript can retrieve the default page name that is hidden within the browser's URL

When a URL is entered without a specific file name at the end, such as "www.google.com," the server typically serves a default file like "index.html" or "default.aspx." In this scenario, if the browser displays "www.google.com," I am looking to extract the ...

Having trouble iterating over an array of objects in Typescript within an Angular application?

When working on my project, I encountered a challenge with fetching data from an API that provides trip entities. Here is the model structure I am using: //Trip.model.ts export class Trip{ created_at?:Date; updated_at?:Date; .... bunch of fields } ...

Delaying Bootstrap 3 Carousel Captions

Website: Issue: I am attempting to integrate the javascript slide.bs.carousel into my code in such a way that the caption appears a few seconds after the image loads in the slideshow. I have inserted the code for 'slide.bs.carousel' within a scr ...

Encountering an Error in Laravel 8: Form Submission Issue - Uncaught TypeError Preventing Property Read

<a href="{{ url('/home') }}">Home</a> <a href="{{ route('logout') }}" onclick="event.preventDefault();document.getElementById('logout-form').submit();">Logout</a> <form ...

Modify the background color of a specific bar across multiple charts when hovering or clicking - utilizing chart.js

I have multiple chart.js canvas elements on a webpage. The goal is to be able to quickly identify and highlight the same bar value across all the charts. For example, when I hover over a bar called "Thu" on the first chart, I want to automatically search f ...

Other Components take turns submitting the form in one Component

Two components, CreateCandidate and Technologies are being used. CreateCandidate requires technologies from the Technologies Component. When passing the technologies to CreateCandidate, the form within CreateCandidate is submitted. Below is the code: Crea ...

Uncertainty lingers over the location of where a JQuery javascript function is invoked in this particular code snippet

Hey there, I'm new to JavaScript and have a question about this demo website: The homepage header features a SlideShow created using a JQuery plugin called FlexSlider. The HTML section for this is as follows: <!-- Slider Section with Flexslid ...

Tips on enhancing an array by separating values with vertical bars instead of commas

I am trying to store checked values in an array and separate them with vertical bars instead of commas. Is there a way to achieve this using the jQuery map .get() function? Any suggestions or links you can provide would be greatly appreciated. Thank you in ...

Is there a way to stop a specific route in Express from continuing further execution without completing its function?

In my post route, I need to ensure that the user has provided all the necessary data in the body. To achieve this, I have added an if block to check for errors. router.post("/", (req, res) => { if(req.body.age < 24) { res.send("You are too you ...

Angular JS shows different results in Google Chrome and FireFox, with some results not displaying in Chrome but showing up in Fire

I have developed a factory named SelectedProduct which is responsible for storing data from ProductDetailCtrl and fetching it in ProductOrder Ctrl Below is the implementation of the factory: .factory('SelectedProduct',function(){ var produc ...

State is not currently utilizing the variable

const DonorsTables = () =>{ const [search, setSearch] = useState(""); const [countries, setCountries] = useState([]); const [filteredcountries, setFilteredCountries] = useState([]); const getCountries = async () => { try { ...

Manipulating geometry properties in three.js with dat.GUI for dynamic changes

I created a spherical shape using the following function let createBall = () => { let geoBall = new THREE.SphereGeometry(5, 32, 16); let mat = new THREE.MeshPhongMaterial({ color: "red", transparent: true }); ball = new THREE.Mesh(geoBa ...

What is the best way to display PHP files as the main landing page on my Express server?

I am currently using php for my home page, but I have come to realize that Node.js does not support .php files. So, I'm looking for a solution on how to address this issue. Below is the code I am using: var app = require('express')(); var h ...

What is the process for setting up a Discord channel exclusively for media with a bot? (Using JavaScript)

Seeking guidance on coding my Discord Bot (Js) to only delete text messages in a specific channel, while preserving images and videos. Does anyone have suggestions on how this can be achieved? ...

Tips for activating text selection in PDF.js

Struggling to enable text selection in PDF.js after successfully displaying a PDF? Seeking a simple example to guide you through the process? Despite trying various approaches, I haven't achieved the desired outcome yet. My current code snippet is a ...

Managing route rendering in nuxtjs: A guide

I came across Goldpage, a tool that allows for route rendering control. Render Control - With Goldpage, you have the flexibility to choose how and when your pages are rendered. For example, one page can be rendered to both HTML and the DOM (classic serv ...