-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Data volume reduction on the client -data types and indices #355
Comments
N-bit Integer RepresentationAn array of 1, 2, 3, ... N-bit integers can be represented using a bit array. Consider an array of M numbers, each with N bits. To represent them, you can use a How efficient is random access in such an array in JavaScript? |
What is not mentioned here but should help improve memory consumption: |
Bitmasks for Widget SelectionThis section explains the bitmask representation used for widget selection, which is ideal for inclusion in Definition
We utilize a bitmask representation where each widget and point is represented by a bit. Memory AllocationIdeally, we should allocate an array of 32 bits for the product of
Selection Logic
Implementation Differences (described above and new Marian pull request)In the existing implementation by Marian, a different logic is used where the columns are bitmask per widget, sized at Additional Memory Requirements for Special Functions
The advantage of Marian’s column-per-widget implementation lies in its update method, which modifies only the corresponding column of the bitmask when a single widget changes. In the row bitmask representation, the decision-making process is swift and does not require a special column. However, since this column is small, the memory savings are minimal (N_points x 32 bits). |
Custom logic imlementation - for later implementation (for later)Currently the selection is only logical && of selections from differnt widgets
In old PAW system configuration was defiend as a custom user defiend string - as shown above. |
refer to #96 |
Optimization of the funCustom - needed to reduce need for exanded functionsTitle: Automatically Generate Function Header for JavaScript Function Based on Used Variables Description: We have a list of all variables present in a table and a JavaScript function (as a string without the header) that uses a subset of these variables. Our goal is to automatically generate the function header for this JavaScript function, including only the variables that are actually used in the function. This is needed as we would like to keep columns compressed and use (expand to) float representation only if needed. Use Case:
Proposed Solution: We will implement an algorithm to achieve this by iterating through the list of variables and checking if each variable is present in the function string. If a variable is found in the function string, it will be added to the function header. Pseudocode:
JavaScript Code: function generateFunctionHeader(columns, functionString) {
let columnArgs = [];
columns.forEach(column => {
if (functionString.includes(column)) {
columnArgs.push(column);
}
});
let header = "function XXX(" + columnArgs.join(", ") + ") {";
return header;
}
// Example usage:
let columns = ["v0", "v1", "v2", "v3", "v4"];
let functionString = "let sum = v0 + v1; let product = v1 * v3; return sum + product;";
let functionHeader = generateFunctionHeader(columns, functionString);
console.log(functionHeader); // Output: "function XXX(v0, v1, v3) {" |
Goal:
Node.js Speed Benchmark:To evaluate the use of compressed float representations for data manipulation, we should compare CPU usage across different types of operations: Representations:
Operations:
Benchmark:
|
Node.js vs Browser CPU Benchmark ConsiderationMarian's Observation-Statement
Marian, could you please provide some examples? Are the differences a matter of percentage points or orders of magnitude? Proposal for Continuing CPU Benchmarks in Node.jsI suggest we maintain CPU benchmarks for the numerical parts of the code in Node.js as well, since it is easier to automate and compare. For regression testing, this will be very important. We should soon move more towards WebAssembly, where I expect the results will be more predictable. Suggested Solution - As per GPT:Based on the observation that performance varies significantly between the browser and Node.js environments for different code snippets, the suggestion to focus benchmarking in the browser and limit Node.js to unit testing appears reasonable. Here's a more detailed approach to implementing this strategy:
|
To facilitate data transfer between the server and client, user-defined lossy and lossless compression is employed.
The techniques discussed below can reduce the data volume on the client. The impact on the speed of subsequent data manipulation should be evaluated:
It is unclear how swiftly specific functionalities can be implemented in JavaScript, the potential slowdown in code performance, and the complexity it might introduce. A subset of these features should be implemented promptly, while the rest could likely be addressed using WebAssembly.
The text was updated successfully, but these errors were encountered: