Closed Pho3niX90 closed 1 week ago
@dimdenGD I am finished with this now if you want to review. I have added a benchmark workflow as well, super basic, and can post to the PR, I think you just need to enable it in your settings. Would give a nice indication if a PR is slowing the code down etc.
Why do {...new NullObject()}? It's like creating a fast object and then creating a slow one and putting it inside. Would be faster to just have {} at this point
Why do {...new NullObject()}? It's like creating a fast object and then creating a slow one and putting it inside. Would be faster to just have {} at this point
My initial thoughts. But ran some benchmarks, and seems it's faster like this. See if you get the same results from it?
I don't see how it's possible for it to be faster that way. Microbenchmarks are often deceptive
So these are the results (tests/sample/object_creation.js):
Min is not the lowest, but more consistent than the spread.
But I am fine with either. Should I change it back to {}
You should probably test some reads+writes too. Also there's no point in using these spreads for internal stuff only used by library, only for public things like req.query and req.params
closes #48