We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Reading text into strings is slow using CurrentLineText

Thread ID:

Created:

Updated:

Platform:

Replies:

108399 Apr 18,2013 08:49 AM UTC Apr 24,2013 11:41 AM UTC WinForms 2
loading
Tags: EditControl
Administrator [Syncfusion]
Asked On April 18, 2013 08:49 AM UTC

I am currently working on a section of my VB.NET project that needs to read out all the text lines in an EditControl and process them. I found that EditControl.CurrentLineText is very slow - about 2mS/line. I tested a 30 line test file with the following code:

For i = 1 to 100    'Do it 100 times to make timing easy
    For l = 1 to Editor.PhysicalLineCount
                Editor.CurrentLine = i
       Process(Editor.CurrentLineText)
    Next
Next

With the Process() doing nothing, the above takes ~6 seconds, or 20mS per line.

I have found however that if I do this:
    

For i = 1 to 10000    'Do it 10000 times to make timing easy
    For l = 1 to Editor.PhysicalLineCount

       Process(GetLineText(i))
    Next
Next

It is about 100 times faster. In fact, I increased the loop count to 10,000 and got about the same 6 seconds total.

Posted in the hope it may help others :-)

                    David Stonier-Gibson

  SPLat Controls Pty Ltd               http://splatco.com
Ph +61 3 9773 5082                       Fx +61 3 9773 5091
   LinkedIn: http://au.linkedin.com/in/davidstoniergibson
 *** This email does not constitute professional advice **
   Free newsletter  http://splatco.com/control_matters/
       Terms of sale: http://splatco.com/skb/2097.htm


Administrator [Syncfusion]
Replied On April 18, 2013 09:04 AM UTC

Oops. I should be processing line Ell, not Eye.

Paul Anderson S [Syncfusion]
Replied On April 24, 2013 11:41 AM UTC

Hi David,

Thanks for your interest in Syncfusion products,

In EditControl the CurrentLineText is used for many operations. Hence when we use that it will take some time to process all the operations related to that when it is used. But GetLineText gets only the text of the given line and its not involved in any other operations and hence its execution is faster compared to CurrentLineText. Thanks for your update regarding this.

Please let us know if you have any concerns.

Regards,
Paul Anderson S

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;