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

Add support for Memory Mapping and HPGL2 un-terminated commands #2

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

kevLmurphy
Copy link

@kevLmurphy kevLmurphy commented May 8, 2024

Adds Memory Mapping and some HPGL2 fixes.

Memory Mapping

Adds support for memory mapping if the input file is <2 GB. It will still fall back to the slow streams if the input is larger.

In my experiments this has had an average performance gain of about 30-50x over the default streams.

Sample performance:

pclFileSize=339509 KB
TotalSeconds= 52.3692026

(After pointing pcl-dumper to the new fork).

Note : there are some excessive comments on the ByteBuffers, which are only used for Standard-in, which is currently only used in testing cases. This code is somehow much more convoluted than the same code for the MappedByteBuffer, for reasons that I never fully understood without staring at the documentation for hours.

HPGL2 Commands without a Terminating Character

Adds support for HPGL2 commands that are not terminated by a ';'.

In those cases, the parser now tries to handle by looking for an escape character and treating it the exact same way as if it were a terminator. This will pass the stream back to the proper handler to receive the exit signal for HPGL2 mode.

(The most common area I have encountered this is output from Oracle Documaker's PCL output. It likes to issue "PW" commands to set the pen width, and never terminates them with a ;. It always reliably issues the esc sequence to return from HPGL2 mode, however.)

Missing HPGL2 Commands

There were three additional HPGL2 commands that were missing.

Kevin M added 7 commits May 8, 2024 14:40
 * Memory Mapping for faster streaming of PCL files <2GB, increases speed by
   factor of 100x
 * Support for no-termination HPGL2 commands. (Oracle Documaker loves
   the PW command without one).
 * Gradle builds on Java 1.8.
 * A couple of missing HPGL2 commands.
Removes extraneous comments
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

Successfully merging this pull request may close these issues.

1 participant