Skip to content

Tests are done without checking the results. #14

@Pokute

Description

@Pokute

The results are practically invalid since the tests don't actually care about the results. This means that javascript engines can and will optimise away critical code.

*************** Map performance check ***************
js map: 15.636ms
for loop: 8.461ms
for each: 17.376ms
lodash map: 18.545ms
*************** Map performance check with result check ***************
js map: 6.106ms
sum: 49886314
for loop: 22.985ms
sum: 49886314
for each: 7.250ms
sum: 49886314
lodash map: 27.305ms
sum: 49886314

The latter case is where I just console.log the sum of commentCounts after each run and outside the timing blocks. This completely turns the results around.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions