Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. Performance with Editor

Performance with Editor

Scheduled Pinned Locked Moved Visual Basic
regexhelpquestiondata-structuresperformance
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Cecil Cheah
    wrote on last edited by
    #1

    Hi there I wonder if anyone can help me with my problem. I am building an Programming Editor for my Healthcare Software at work. The editor that comes with it is useless. One formular i am using notepad to programme has over 20,000 lines of codes. I have started making an editor and the problem is it takes ages to read all the keywords and find the line and add this to a Treeview control. I use Regular Expression to reduce the time to find the keywords. However, i have to loop over each item in the Regular Expression Match Collections in order to find the line where each match occurs. This will enable me to add each keywords and the line number to the tree view control. This loop with my 20,000 lines of codes seems to take ages. Can someone tell me how can i increase the performance? Shall i use Multithreading to do all the looping in the background? However, this will only hide the problems. When the Form appears and the user clicks the treeview structure, the background tasks may not have been completed yet. Can anyone tells me how to solve this performance problem?

    E 1 Reply Last reply
    0
    • C Cecil Cheah

      Hi there I wonder if anyone can help me with my problem. I am building an Programming Editor for my Healthcare Software at work. The editor that comes with it is useless. One formular i am using notepad to programme has over 20,000 lines of codes. I have started making an editor and the problem is it takes ages to read all the keywords and find the line and add this to a Treeview control. I use Regular Expression to reduce the time to find the keywords. However, i have to loop over each item in the Regular Expression Match Collections in order to find the line where each match occurs. This will enable me to add each keywords and the line number to the tree view control. This loop with my 20,000 lines of codes seems to take ages. Can someone tell me how can i increase the performance? Shall i use Multithreading to do all the looping in the background? However, this will only hide the problems. When the Form appears and the user clicks the treeview structure, the background tasks may not have been completed yet. Can anyone tells me how to solve this performance problem?

      E Offline
      E Offline
      Enriad
      wrote on last edited by
      #2

      One way would be to use delegate's to perform the looping. Set the enabled value of the treeview to false and once the looping has finished, set it to true. This will stop people from clicking on it before you want them to. There are some good tutorials on MSDN for delegating, though not many for placing arguments/paramters in the functions (if someone could let me know one, that would be great, I lost the bookmark and my code when my old HDD died :( ) As for the faster matching, there isn't an overly fast way to loop over 20,000 lines of an array, you might have to deal with the regex loop searching. I'd have to take a look at the search part of the code to see, though you could try a google hit for 'vb.net text search optimizing' Daniel

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups