Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign uptreewalker is substantially faster than xpath #13
Conversation
retorquere
added some commits
Apr 2, 2019
adam3smith
reviewed
Apr 2, 2019
numDOIs++; | ||
if (numDOIs == 2) break; | ||
} | ||
var numDOIs = Object.keys(selectArray).length; |
This comment has been minimized.
This comment has been minimized.
adam3smith
Apr 2, 2019
Owner
did you understand what was going on here? Why do we break at 2 and not at 1 above?
This comment has been minimized.
This comment has been minimized.
retorquere
Apr 2, 2019
•
Author
I thought it was for performance reasons. But come to think of it, then 1 would have sufficed.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
adam3smith
Apr 2, 2019
•
Owner
yup, I know, and it should be possible to do this without the while loop either way (if we want to check for length>1 we can do that) but I want to know what's going on here before changing it.
@zuphilip , do you happen to remember?
This comment has been minimized.
This comment has been minimized.
Is the |
This comment has been minimized.
This comment has been minimized.
You're completely right, I think we can scrap all of that (need to make sure that we're still failing gracefully on DOIs that either aren't DOIs or aren't covered by the search translator) |
This comment has been minimized.
This comment has been minimized.
You want me to take a stab at that? |
This comment has been minimized.
This comment has been minimized.
That would be great, yes.
…Sent from my phone
On Wed, Apr 3, 2019, 1:29 AM Emiliano Heyns ***@***.***> wrote:
You want me to take a stab at that?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#13 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAH32lUGHUQfEFdNubtU_p2T0sgSmKs-ks5vdDxIgaJpZM4cZBdd>
.
|
This comment has been minimized.
This comment has been minimized.
I couldn't find anything in the existing code that dealt with graceful handling of non-resolvable DOIs. The remaining DOIs were passed to the next provider, but if DOIs went unresolved at the end of that chain, |
This comment has been minimized.
This comment has been minimized.
Not that I'd propose changing too much at the same time, but are promises available in browser? So much of this could at a later change be cleaned up with promises. |
This comment has been minimized.
This comment has been minimized.
That's graceful enough for given purposes
I believe so, yes, but would want @dstillman to confirm. Obviously only four Zotero version 5+ |
This comment has been minimized.
This comment has been minimized.
It's not something I intend to introduce right now, but I can see the outline of how it would look. |
dstillman
reviewed
Apr 3, 2019
This comment has been minimized.
This comment has been minimized.
I was a little nervous around removing the IIFE as sometimes async requires it to keep scope, but I've looked at the code and it seems safe. Tests pass. |
dstillman
reviewed
Apr 3, 2019
DOI.js Outdated
This comment has been minimized.
This comment has been minimized.
This is great, thanks -- and yes, it does feel quite zippy |
retorquere commentedApr 2, 2019
treewalker is substantially faster than xpath -- I thought it would just be an architectural cleanup, but in my totally subjective hey-this-feels-faster tests, it does seem to make an actual difference, especially on the last test.
Also: address linter reports.