1. François Rossignol
  2. PowerBuilder
  3. Wednesday, 15 April 2020 13:55 PM UTC

Hi

 

I have a log functionnality that reads data from a datawindow and concatenate it into a string.

When the string gets fairly large the performance plumets.

On my test case with 3600 lines in the DW

ls_string += ls_added_data => 25 minutes

ls_string = ls_added_data => 2 seconds

 

I know the fastfuncs dll would solve my problem but we plan on using PowerServer and last time we tested it was not compatible.

 

I wanted to write a simple C++ dll to concatenate the strings but I know nothing of C++ and so far my tests resulted in PB crashing.

I tried different datatypes and functions.

I had a sample function to add two numbers which works perfectly.

 

If someone would be kind enough to give me the code for the C++ function or any other way to work around that situation that would be really appreciated.

 

Regards,

François

Accepted Answer
mike S Accepted Answer Pending Moderation
  1. Wednesday, 15 April 2020 14:06 PM UTC
  2. PowerBuilder
  3. # Permalink

use blobs instead.   this is an example of how to do that:

https://www.topwizprogramming.com/freecode_stringclass.html

Comment
  1. mike S
  2. Wednesday, 15 April 2020 15:07 PM UTC
thank Roland, it's his code and he maintains the website.
  1. Helpful
  1. Miguel Leeuwe
  2. Wednesday, 15 April 2020 15:18 PM UTC
That's a great attitude Mike
  1. Helpful
  1. François Rossignol
  2. Thursday, 16 April 2020 08:06 AM UTC
Yes of course big thank you Roland (sorry about that) for all the great tools you provide for the PowerBuilder community.
  1. Helpful
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Thursday, 16 April 2020 17:46 PM UTC
  2. PowerBuilder
  3. # 1

Hi François ;

   FYI:  This technique is even easier, faster and all pure PB code ...

https://community.appeon.com/index.php/qna/q-a/mutable-string-type-needed-pbni-c-possibility#reply-9331

Works in PowerServer too!   HTH 

Regards .... Chris

Comment
  1. Roland Smith
  2. Thursday, 16 April 2020 17:52 PM UTC
That is the technique used in my example. It pre-allocates a blob and uses blobedit to insert data.
  1. Helpful
  1. Chris Pollach @Appeon
  2. Thursday, 16 April 2020 18:01 PM UTC
That is Awesome Roland ... I've been using this code for decades! ;-)
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.