Conversation
yes, i can fix |
brennoaf
left a comment
There was a problem hiding this comment.
tested many times, for some reason, adding a log specifically in 'filter' improves code performance by 25%~.
I left it open for observation
platypii
left a comment
There was a problem hiding this comment.
Still some linting errors, please run npm run lint to find them
src/query.js
Outdated
|
|
||
| // logging specifically 'filter' here gave a 25% performance boost, lol | ||
| // maybe forces JIT to improve this part of the code | ||
| const forceJIT = () => {console.log(filter)} |
There was a problem hiding this comment.
This is not an acceptable change. Can't be doing console.log in a library. I'm open to suggestions but this feels like a brittle optimization that might not work in different environments? (browser, node, etc)
There was a problem hiding this comment.
I know, I'm investigating a similar and not so grotesque way. But it made me curious, I tested it via express + firefox and it really improved, I'll try to see another way and expand the tests
| filteredResults.sort((a, b) => compare(a[orderBy], b[orderBy])) | ||
| } | ||
| return filteredResults.slice(rowStart, rowEnd) | ||
| } else if (orderBy) { |
There was a problem hiding this comment.
nit: this is a breaking change for the corner case where orderBy === '' ('' is a valid object key, but Boolean('') === false)
parallel fetch added + logic operators conditions remade for better performance -> return, break + clean
20% faster