Closed Bug 1679506 Opened 2 years ago Closed 9 months ago

Print preview and saving files to pdf is very slowly

Categories

(Core :: Print Preview, defect, P2)

Desktop
All
defect

Tracking

()

RESOLVED FIXED
96 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox-esr91 --- fixed
firefox83 --- wontfix
firefox84 --- wontfix
firefox85 --- wontfix
firefox86 --- wontfix
firefox87 --- wontfix
firefox88 --- wontfix
firefox95 --- wontfix
firefox96 --- fixed

People

(Reporter: atrif, Assigned: jwatt)

References

(Blocks 1 open bug)

Details

(Keywords: perf, regression, Whiteboard: [print2020_v91] [old-ui-])

Attachments

(2 files)

Affected versions

  • 83.0 (20201112153044)
  • 84.0b5 (20201126155845)
  • 85.0a1(20201116094341)

Affected platforms

  • macOS 10.12

Steps to reproduce

  1. Open Firefox and a random page.
  2. Click print from the hamburger menu

Expected result

  • Print preview is opened as expected.

Actual result

  • Print Preview has a very long loading time on previewing the file.

Regression range

Notes

  • After a while, the print preview is loaded but saving the pdf results in another long wait time but resulting in a successful print.
  • Attached a screen recording with Firefox 82.0.3(unaffected) and Firefox 84.0b5: link.
  • Print Preview is also reloaded very slow when changing settings(e.g scale, pages, paper size etc.)
  • Also it seems that clicking the Cancel button while the preview is loading and then pressing CMD+P from the keyboard results in the Print Preview window being opened only after 1 minute or so. I don't know if I should open another bug for this behavior or it's the same issue.

Suggested Severity: S3

Has Regression Range: --- → yes
Has STR: --- → yes

The print preview seems to open "instantly" for me. Could you capture a profile using the Firefox profiler of this, and post a link to it, so we can try and figure out why it's so slow there? Thanks.

Flags: needinfo?(alexandru.trif)

(In reply to Jonathan Kew (:jfkthame) from comment #1)

The print preview seems to open "instantly" for me. Could you capture a profile using the Firefox profiler of this, and post a link to it, so we can try and figure out why it's so slow there? Thanks.

Yes, ofc. Here is the link: https://share.firefox.dev/2L0XrPx. If there's anything else I can help with please let me know. Thank you!

Flags: needinfo?(alexandru.trif)

There's a 30-second delay here in handling the Msg_PrintPreview message. There are a number of (low-priority) network requests in the content process that seem to be totally stalled (why?), but I don't know if we're specifically waiting on those. The delay being more or less exactly 30 seconds makes me wonder if there's a timeout that we eventually hit, and then DOMContentLoaded finally fires; and only after that does Msg_PrintPreview complete.

No idea why, though. It doesn't look like the browser is busy with anything; it's just waiting, waiting.... :jwatt, do you have any idea what could be going on here?

Flags: needinfo?(jwatt)
Duplicate of this bug: 1679177
Severity: -- → S2
Priority: -- → P2
See Also: → 1682663

This is still broken (exhibits the same behavior) in Firefix Mac 84.0.1

I am also experiencing performance issues when it comes to loading the content of the page in the Print Preview window. This issue is reproducible with both the old and new Print UI. I have used the Profiler tool in order to capture the profile as it follows:

  1. new Print UI
  2. old Print UI

Please note that I have also uploaded the files as attachments to this report in case the profiles are too big to be displayed smoothly using the links.

Environment:

  • platform: Windows 10 x64
  • browser versions: Firefox Release 84.0.1, Firefox Beta 85.0b4, Firefox Nightly 86.0a1

Please let me know if you need any additional information.

I can also confirm that the issue is encountered on Ubuntu 16.04 x86, with Beta 85.0b5. I'm going to remove the macOS tag from the title, in order to reflect that the issue is more like a general one, which happens across platforms.

Summary: [macOS10.12] Print preview and saving files to pdf is very slowly → Print preview and saving files to pdf is very slowly
See Also: 1682663
Duplicate of this bug: 1682663
OS: macOS → All
Flags: needinfo?(jwatt)
Whiteboard: [print2020_v85] [old-ui-] → [print2020_v87] [old-ui-]

This bug still exists in Firefox Mac v85.0! Had to change to using chrome. #;-(

See Also: → 1686983

Firefox 86.0 MacOS 10.2.6

  • when attempting to print a web page, it takes about 30 seconds for the preview page to appear
  • change the printer ... wait another 30 seconds
  • print to PDF ... wait another 30 seconds

... back to Chrome <sigh>

I had been blind about the fact the this issue seems to happen only on MacOS 10.12. And https://hg.mozilla.org/mozilla-central/rev/3c6ac25bb5d5076576a99a81c12c654952297c3a is a suspicious change in the regression range in comment 0.

So I wonder whether disabling print.cups.monochrome.enabled will fix this issue or not.

Hey Alexandru, would you mind trying to set print.cups.monochrome.enabled to false to see if it mitigates this issue?

Flags: needinfo?(alexandru.trif)

geez, geez. I did forget what comment 9 said, I read it yesterday, now I totally forget about it. Anyways, I think there are several reasons to make print preview slow, and one of the reason might be the monochrome support issue.

(In reply to Hiroyuki Ikezoe (:hiro) from comment #13)

I had been blind about the fact the this issue seems to happen only on MacOS 10.12. And https://hg.mozilla.org/mozilla-central/rev/3c6ac25bb5d5076576a99a81c12c654952297c3a is a suspicious change in the regression range in comment 0.

So I wonder whether disabling print.cups.monochrome.enabled will fix this issue or not.

Hey Alexandru, would you mind trying to set print.cups.monochrome.enabled to false to see if it mitigates this issue?

Hello! I tried on a new profile by setting print.cups.monochrome.enabled:false, then restarted the browser using the latest Nightly (2021-02-25) on macOS 10.12, but the issue is still reproducible. If more information is needed please let me know.

Flags: needinfo?(alexandru.trif)

I looked into why it's hanging on macOS and found that CreateOrCopyPrintInfo() is hanging [see profile at https://share.firefox.dev/3qKlzoB ]. I note that the most recent change to this function were the patches caused by bug 1667053.

My current theory is that this could be (on macOS Sierra, anyway) a regression caused by the bug 1667053 fixes. Perhaps while trying to get sysPrintInfo, the attempt causes CUPS (used by AppKit) to time out after waiting 30 seconds?

Keywords: perf
Whiteboard: [print2020_v87] [old-ui-] → [print2020_v91] [old-ui-]
QA Whiteboard: qa-not-actionable

Alexandru, according to your comment in bug 1696640 this is fixed, right?

Flags: needinfo?(alexandru.trif)

Yup, I can no longer reproduce this on my macOS 10.12 machine with 96.0b6 and the latest nightly. Saving to PDF and print previews happens almost instantly on random web pages and PDF docs.

Flags: needinfo?(alexandru.trif)
Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Assignee: nobody → jwatt
Depends on: 1740421
Target Milestone: --- → 96 Branch

Yay ... finally prints without delay ... back to being able to use Firefox. Thanks!

You need to log in before you can comment on or make changes to this bug.