bugGNU Octave - Bugs: bug #49492, gl2ps buffer size should be sized...

 
 

bug #49492: gl2ps buffer size should be sized only once when producing Latex output

Submitter:  Rik <rik5>
Submitted:  Mon 31 Oct 2016 07:33:54 PM UTC
   
 
Category:  Performance Severity:  2 - Minor
Priority:  3 - Low Item Group:  Performance
Status:  Fixed Assigned to:  None
Originator Name:  Open/Closed:  * Closed
Release:  * dev Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 13 Nov 2016 02:17:33 PM UTC, comment #2: 

The patch didn't compile, but I removed an unnecessary '=' sign and then it worked.  I checked it in here (http://hg.savannah.gnu.org/hgweb/octave/rev/50fa2d656326).

Fixed, closing report.

Rik <rik5>
Group administrator
Fri 11 Nov 2016 06:32:54 PM UTC, comment #1: 

I attached a patch.

(file #38936)

Pantxo Diribarne <pantxo>
Group Member
Mon 31 Oct 2016 07:33:54 PM UTC, original submission:  

The sequence to produce output for Latex involves calling gl2ps_renderer::draw twice.  See this comment in gl2ps-print.cc:


// For LaTeX output the print process uses 2 drawnow() commands.
// The first one is for the pdf/ps/eps graph to be included.  The
// print_cmd is saved as old_print_cmd.  Then the second drawnow()
// outputs the tex-file and the graphic filename to be included is
// extracted from old_print_cmd.


If the plot to print is very complicated, the gl2ps buffer may overflow in which case Octave has to retry with a larger buffer size.  This is fine, but after the first drawnow(), the correct buffer size is known and it shouldn't be necessary to go through the time consuming step of sizing the buffer again.

Code which produces problem:


nx=400;x=linspace(0,2*pi,nx);
ny=400;y=linspace(0,2*pi,ny);
array=sin(x).*transpose(sin(y));
pcolor(x,y,array);
print("temp","-depslatexstandalone");
#print("temp","-deps");  # This produces only one overflow sequence



Rik <rik5>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #38936:  buffsize.patch added by pantxo (1KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by pantxo (Updated the item)
  • -email is unavailable- added by rik5 (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-11-13 rik5 StatusPatch Submitted Fixed
        Open/ClosedOpen Closed
    2016-11-11 pantxo Attached File- Added buffsize.patch, #38936
        StatusNone Patch Submitted
    2016-11-07 rik5 Priority5 - Normal 3 - Low

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code