Skip to content

Performance vs. citeproc-js #143

@dstillman

Description

@dstillman

https://forums.zotero.org/discussion/93803/performance-hit-with-citeproc-rs

When I was testing citeproc-rs in Zotero, performance seemed like a mixed bag: CSL Preview (which generates output in all installed citation styles, and maybe involves an engine instantiation for each one) was dramatically faster than citeproc-js — about 2x — but generating a large bibliography was about the same or a little slower. adamsmith is reporting it taking over twice as long to generate 250 items in APA 7 as HTML and text:

citeproc-js:

(3)(+0001972): Copied bibliography to clipboard in 6156 ms}

citeproc-rs:

(3)(+0000018): Copied bibliography to clipboard in 13198 ms}

In terms of the debug output:

(5)(+167588974): CiteprocRs: new Driver

(3)(+0000013): CiteprocRstoJs: updateItems [forwarding to updateUncitedItems()]

(5)(+0000008): CiteprocRs: insertReference {"id":"33938","type":"article-journal", ,"container-title":"Bib(La)TeX Journal" […]

[lots of those]

(5)(+0000000): CiteprocRs: bibliographyMeta

(5)(+0000001): CiteprocRs: makeBibliography

(5)(+0000001): CiteprocRs: makeBibliography

(3)(+0005118): DATE: algorithms failed sanity check

[…]

(5)(+0000016): CiteprocRs: free Driver

(5)(+0000014): CiteprocRs: new Driver

(3)(+0000004): CiteprocRstoJs: updateItems [forwarding to updateUncitedItems()]

(5)(+0000000): CiteprocRs: insertReference {"id":"33938","type":"article-journal", ,"container-title":"Bib(La)TeX Journal" […]

[all the same entries again]

(5)(+0000000): CiteprocRs: bibliographyMeta

(5)(+0000000): CiteprocRs: makeBibliography

(5)(+0007589): CiteprocRs: free Driver

(3)(+0000018): Copied bibliography to clipboard in 13198 ms}

So the first makeBibliography from -rs takes 5 seconds. The second takes 7.5. -js takes 6 seconds total.

@cormacrelf, how does this compare to the performance you were seeing natively? How much of this do we think this is due to Firefox 60 and/or wasm, as opposed to differences in optimizations between the two engines?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions