View Issue Details

IDProjectCategoryView StatusLast Update
0018328MMW 5DB / Backuppublic2021-09-21 12:54
Reporterdrakinite Assigned To 
PriorityhighSeverityminorReproducibilityalways
Status newResolutionopen 
Product Version5.0.2 
Target Version5.0.3 
Summary0018328: Tracklist forEach function does not appear to use the same the same ICefV8Value object
DescriptionAs discussed offline, the forEach tracklist function appears to create a new object each iteration, instead of internally utilizing the getFastObject function.

The speed difference can be demonstrated with the following code:

app.playlists.getByTitleAsync('Accessible Tracks').then(async (itm) => {
let tl = itm.getTracklist();
await tl.whenLoaded();

let st = window.performance.now();
let ids = new Int32Array(tl.count);
let i = 0;
tl.forEach(track => {
    ids[i] = track.idsong;
    i++;
});
console.log('forEach: ' + (window.performance.now() - st));

tl.locked(() => {
    let st = window.performance.now();
    let ids = new Int32Array(tl.count);
    let song;
    for (let i = 0; i < tl.count; i++) {
        song = tl.getFastObject(i, song);
        ids[i] = song.idsong;
    }
    console.log('getFastObject: ' + (window.performance.now() - st));
});
});
TagsNo tags attached.
Attached Files
image.png (42,396 bytes)   
image.png (42,396 bytes)   
Fixed in build

Activities