Skip to content
This repository has been archived by the owner on Feb 18, 2021. It is now read-only.

Reference matching performance is poorer than expected #142

Open
axfelix opened this issue Apr 27, 2018 · 6 comments
Open

Reference matching performance is poorer than expected #142

axfelix opened this issue Apr 27, 2018 · 6 comments

Comments

@axfelix
Copy link
Contributor

axfelix commented Apr 27, 2018

I think there may have been a regression to our performance in matching inline references to the bibliography -- also noticing that we're sometimes getting YYYY-Mon style data returned under the <year> element returned from CrossRef, which we may need to strip as it could be a contributing factor.

@axfelix
Copy link
Contributor Author

axfelix commented May 15, 2018

Actually, I think part of this is that Texture is dying on line length when we paste the ref-list back into the document as a single string. We probably just need to run the equivalent of xmllint --format on that when we're doing it...

@axfelix
Copy link
Contributor Author

axfelix commented May 15, 2018

@kaschioudi, would it make sense to just run an xmllint --format command at some point in the document_final (stage 20) module? This stack always makes CLI calls and updating files directly more confusing than I'd like...

I added a stub in b18bc54, does it look right? I'm not actually making the call yet...

@kaschioudi
Copy link
Contributor

@axfelix : I did not run the code but it looks good to me. However I believe addRetrieve line is not required.

@axfelix
Copy link
Contributor Author

axfelix commented May 16, 2018

Really? xmllint normally just outputs to stdout, so I think I need that if I'm running the shell command with the intent of writing directly to a filepath on the disk, but I guess I could just capture stdout instead, I'm just not sure how best to write it over our existing xmlfinal doc at that point.

@kaschioudi
Copy link
Contributor

I may be wrong but here's my understanding of the inner working.

OTS Command class calls PHP's exec function (http://php.net/manual/en/function.exec.php) behind the scene.

exec($this->command, $this->output, $this->returnStatus);

and the command output is stored in $this->output which can be obtained by calling Command:: getOutputString()

However sometimes the error output (STDERR) also needs to be redirected to the output error (STDOUT) and I believe it's done like this $command->addRedirect('2>&1 >/dev/null');

@axfelix
Copy link
Contributor Author

axfelix commented May 16, 2018

Yeah, I know how to redirect stderr to stdout, I'm mostly not clear on how best to actually write the output (however we're capturing it) over the preexisting XML :)

If I use the stdout redirect, we don't have any $this-output. If we use this function with $this->output, then I don't need to pass it an output filename, I just need to return the output, and write it over what we have. I'll play with it...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants