Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post worker-patch work #690

Closed
jviereck opened this issue Oct 20, 2011 · 4 comments
Closed

Post worker-patch work #690

jviereck opened this issue Oct 20, 2011 · 4 comments
Assignees

Comments

@jviereck
Copy link
Contributor

It seems like landing worker support is close. However, there is still a lot of things that can/should be done. This issue serves as a brain storming issue to pin down the refactoring ideas and discuss them.

@jviereck
Copy link
Contributor Author

  • Creating IR forms for objects like Patterns/Colorspaces require to create an new JS object instance, although all you do is call .getIR() on the object, which can also be done in an functional aproach. Kill the extra JS object creating to have less GC runs
  • the current code, that rebuilds from the IR/IRQueue, is very specific to the canvas backend. E.g. the Pattern code assume the output is canvas. This global 'create from IR' classes should move somewhere, where they are scoped to the CanvasGraphics only.
    Where it's possible, the object should become simple function calls whenever possible. In cases where creating objects is still necessary, these objects might be placed on the CanvasGraphics, such that everything is kept in there.

@jviereck
Copy link
Contributor Author

  • add feature detection to turn on workers whenever this is possible in a certain environment.
  • for most every object in the pdf, save the IR information in a JS object, that one can refer on later. This also ensures the IR form for an pdf object is created only once.
  • once the notion of objects per pdf object is in place, figure out if there is a speedup if we process each object individual. E.g: The PartialEvaluator notices, that it needs object no. 2, which is an image object. So it sends a message to the main thread, which checks if object no. 2 was processed/if there exists an IR form already. If not, it posts a message to another worker, which then creates the IR form for object no. 2.
  • once each pdf object is processed on its own, sending only the stream data for this particular pdf object to the worker thread is required. This means, it's not necessary anymore to send over the entire PDF document, although this is way too much for rendering only a few pages of it.

@ghost ghost assigned jviereck Oct 29, 2011
@arturadib
Copy link
Contributor

Here's a list I've kept since the patch merge:

  • (Global) Address the relatively minor comments labeled TODO in the final Pull Request Web worker integration. #692
  • (core.js) Merge or eliminate PDFDocModel (I think @jviereck already wanted to do this)
  • (Global) IR and IRQueue: This is difficult for newcomers to understand, even though the underlying concepts are simple. Since Cmd() is already taken, how about simply instr and code?
  • (core.js) startRenderingFromIRQueue: ohMyGoodnessThisIsReallyLong! In the new spirit, how about renderCode, since there will be no ambiguity as we don't render PDF's code directly?
  • (core.js) this.pdf: I had to look this one up to know what "pdf" means here. How about this.pdfDoc?

@brendandahl
Copy link
Contributor

I believe most of these have been addressed by some rewrites and the new API.

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

No branches or pull requests

3 participants