Drastic Speed difference between Wptools 5 and Wptools 4 ?

  • Hello

    We recently upgraded to WPTools 5 from WPtools 4 and we are using Delphi 7. When trying to print letters that are stored in a table it is taking a very long time to print the letters. It appears to be the amount of text/images etc in the letter that are affecting it. However it doesn't take long in Wptools 4 to print the letters.

    Below is one part of the code that is killing us.

    FDBWPRichText1.DataField := cLetter; //cLetter represents the field
    in which the letter is stored.

    When trying to assign the field it is taking upwards of 2 minutes to perform the assignment. The bigger the letter the more time it takes.

    The next line is also taking upwards of 2 minutes.
    FWPRichText1.Memo.RTFData.AssignFDBWPRichText1.Memo.RTFData);


    Is there anyway that we could speed up the process? Wptools 4 was much quicker when performing the above actions.

    Thank you!

    • Offizieller Beitrag

    Hi,

    >>Drastic Speed difference between Wptools 5 and Wptools 4 ?
    Yes, in general WPTools 5 should be lot faster!

    WPTools 5 has a much faster RTF reader than WPTools 4. In fact it is one of the fastest available, it loads the RTF specs (220 pages) until display in less than 8 seconds on the test computer - when compiled with Delphi 2006. It also does not require more memory than V4, sometimes less (the usage is more dynamic).

    So I think your code is not ideal here. You seem to use a TWPRichText to print data which was stored in a DBWPRichText. Why not load the data directly into the TWPRichText from a blobfield.

    The property WPRichText.WriteObjectMode should be set to wobRTF for best results. Using "NoBinary" can slow things down since the hex encoding takes time although some databases require it.

    Do not use a datasensitive control for your letters - esspecially if the texts are large. The control will perform unnecessary reloads because of the way the data sensitive controls work.

    instead of
    FWPRichText1.Memo.RTFData.Assign(FDBWPRichText1.Memo.RTFData)

    use
    FWPRichText1.AsString := cLetterField.AsString.

    If you really need the data sensitive control use
    FWPRichText1.AsString := FDBWPRichText1.AsANSIString('RTF');

    Note: The Assignment of text of one control to another can really be slower in V5 than in V4 - the reason is that internally the wptools reader/writer will be used for this assignment. In V4 it was direct, that is also possible in V5 but requires that both components use the same RTFProps object so they use exchangeable font, color and style tables. (See GlobalStyle demo).

    Regards,

    Julian

    2 Mal editiert, zuletzt von support (18. August 2006 um 10:26)