Re: sorting/printing speed FMP9 vs. FMP6



On May 5, 4:33 pm, Martin Trautmann <t-...@xxxxxxx> wrote:
On Mon, 5 May 2008 16:02:57 -0700 (PDT), d-42 wrote:
All of this does not explain why sort and print are that slow.

When you say sort and print are 'slow'. What do you mean specifically?

As said before, 2 hours compared to > 24 hours

I mean timing for a specfic operation, not the total runtime. How much
longer does a -given- sort take? How much longer does a given print
take? Does it average it 1.2 seconds to sort, and 2.6 seconds generate
a pdf on FM6, but 1.3 seconds to sort, and 12.6 seconds to generate
the PDF on FM9? Or maybe its 12.5 seconds to sort, but 0.5 seconds to
print...


You open up a file, and perform a basic sort on a single indexed field
in the table attached to the current layout, and its orders of
magnitude slower than it was on FM6? Under what conditions is sorting
so much slower?

No - I use one file, copy certain field contents,

then I go to the main file (external script), enter find mode, paste,
add some extra values, sort the results, print them to a pdf, rename
this pdf and exit this external script

to loop to the next record, copy, and continue as above.

Alright, so *is* a process, and worse, no offense, but the script you
describe sounds almost like it was designed to run as poorly as
possible!!

1) Have you tried profiling it at all to isolate what percentage of
time is taken by each step? This can be very instructive. The
profiling will slow it down even further, but the information gained
will tell us where the time is being spent.

If the numbers are low, set up loops for each operation to perform it
1000 times, and then measure the time to do it 1000 times. You'd be
surprised. For example, it takes 15 seconds (on a Core 2 Quad running
at 3GHz ) to copy a text field with 20 characters in it to the clip
board 10,000 times. It takes 1 second to copy that text field to a
local variable 10,000 times.

2) Why use an external script? Why not localize it all in one file.
That tends to make a significant difference to performance in new
versions of FM. (keep the actual data in multiple external files if
you like, but link to them as table occurrences in the file that runs
the script.

3) Don't use copy and paste. That incurs a performance hit. Use a
variable, global variable, or global field depending on the
circumstances. See above, it can be worse by a factor of ~15. Its
probably not what's killing performance in -your- case, but it
underscores the difference suboptimal choices make.

4) Why are you saving and then renaming the file? FM9 can create the
file with the name you want directly.

5) On a looping script make use of freezewindow to prevent needless
repainting. I usually implment a 'progress bar', that repaints every
few seconds or so (so the application doesn't look hung up). It can
make a gigantic difference.

All that said, We can clearly speed it up some, but I can't say it
will solve your problem. It might well simply be the PDF generation is
the bottleneck or the sorting is the bottleneck and there isn't much
that can be done about it. But I'd want to see some hard evidence of
this before throwing in the towel.

-cheers,
Dave




.



Relevant Pages

  • Re: Generics article
    ... with an option to download as PDF. ... of IComparableand sorting is in a different chapter of his. ... Immediately when I saw you sort Person by calling name.CompareTo, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: latex in Office 2008:mac
    ... If you're converting from pdf, ... Might it be that PowerPoint is grabbing some low-res preview version ... rather than the full res file, sort of thing? ... to use Powerpoint out of sheer unfamiliarity with beamer. ...
    (comp.text.tex)
  • Re: "Doing" datasheets
    ... but can OO do this sort of thing? ... I can create a pdf file with pdf995 from my CAD system. ... But I dont know how create a pdf with text, ...
    (sci.electronics.design)
  • Re: [SLE] Print to PDF? Solved... sort of
    ... > I notice that any function that uses kprinter will allow printing to a PDF. ... I sort of got it.... ... but now I get CUPS errors. ...
    (SuSE)