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

PPD: Message Processing Bottlenecks #4075

Closed
michaelrsweet opened this issue May 10, 2012 · 2 comments
Closed

PPD: Message Processing Bottlenecks #4075

michaelrsweet opened this issue May 10, 2012 · 2 comments
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.6-current
CUPS.org User: chulbert

The currently recommended approach for encoding binary data in PPD files through PPD: messages from a filter suffers serious performance issues when the amount of data becomes large. Even more so when the PPD file is large.

Each PPD: message causes the PPD file to be read by line and written to a copy. If a filter emits 10s or 100s of messages this can result in 10s or 100s of megabytes of disk access, which can make the scheduler non-responsive. On OS X, this can lock the application and deny service to concurrent users.

While concise encoding, compression and multiple attributes per PPD: message help reduce the impact, the problem remains unsolved.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

@michaelrsweet
Copy link
Collaborator Author

"str4075.patch":

Index: scheduler/job.c

--- scheduler/job.c (revision 10492)
+++ scheduler/job.c (working copy)
@@ -3363,6 +3363,21 @@
cupsArrayRemove(PrintingJobs, job);

/*

  • * Apply any PPD updates...
  • */
  • if (job->num_keywords)
  • {
  • if (cupsdUpdatePrinterPPD(job->printer, job->num_keywords, job->keywords))
  •  cupsdSetPrinterAttrs(job->printer);
    
  • cupsFreeOptions(job->num_keywords, job->keywords);
  • job->num_keywords = 0;
  • job->keywords = NULL;
  • }
  • /*
    • Clear the printer <-> job association...
      */

@@ -4827,18 +4842,10 @@
* Set attribute(s)...
*/

  •  int      num_keywords;   /\* Number of keywords */
    

- cups_option_t keywords; / Keywords */

   cupsdLogJob(job, CUPSD_LOG_DEBUG, "PPD: %s", message);

- num_keywords = cupsParseOptions(message, 0, &keywords);

  •  if (cupsdUpdatePrinterPPD(job->printer, num_keywords, keywords))
    

- cupsdSetPrinterAttrs(job->printer);

  •  cupsFreeOptions(num_keywords, keywords);
    
  •  job->num_keywords = cupsParseOptions(message, job->num_keywords,
    
  •                                       &job->keywords);
    

    }
    else
    {
    Index: scheduler/job.h

    --- scheduler/job.h (revision 10492)
    +++ scheduler/job.h (working copy)
    @@ -80,6 +80,8 @@
    void profile; / Security profile /
    cups_array_t *history; /
    Debug log history /
    int progress; /
    Printing progress */
  • int num_keywords; /* Number of PPD keywords */
  • cups_option_t keywords; / PPD keywords */
    };

typedef struct cupsd_joblog_s /**** Job log message ****/

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

No branches or pull requests

1 participant