Passing WebAsembly memory to WebGL2 Ask Question

In WebGL2, there are additional versions of most existing functions that accept ArrayBuffers that allow passing in offset and length inside these buffers. Supposedly, this should make it easier to pass in data from WebAssembly memory without creating temporary views, but there’s a catch: those functions only accept ArrayBufferView.

  1. What is the reason for such limitation? Why should a function that copies bytes to GPU care about their semantics, i.e. Uint8/Int32/Float32, etc?
  2. How to get around it, without creating a DataView every time (which would completely defeat the purpose of using those functions in the first place)? Creating DataView once wouldn’t work because WebAssembly memory can re-allocate its buffer, and there is no way to set a callback for memory resize.

Magento 2 javascript local storage getitem setitem loop Ask Question

I have a problem with a Magento 2 site.

The problem is that it’s slow on some PC’s and browser. As far as I know the problem is a setItem and getItem loop (and MinorGC and Major GC between them), which lasts like ~46 seconds, on localStorage (maybe). This was tested on a chrome, on the client’s PC. I cannot reproduce this bug. The client said this bug disappears when he clears the browser cache. This whole call starts form require js from here:

req.nextTick = typeof setTimeout !== 'undefined' ? function (fn) {
    setTimeout(fn, 4);
} : function (fn) { fn(); };

According to the profiler the website has 2 different behaviours on my pc and on the client’s PC, he has the getItem and setItem loop , I don’t.

Here is the client’s profiler screenshot

enter image description here