Parallel for in the calculation of MaxWidth #157
Replies: 7 comments 27 replies
-
Very cool! I'll do some benchmarking tomorrow. Great job on those other fixes. |
Beta Was this translation helpful? Give feedback.
-
As an observation. I updated yesterday to include the fix for wide files however my very wide and long files still took minutes to load and the interface was blocked during this time. I saw the parallel MaxWidth work in the tree so assume this should be working. If I set a highlighter after opening the file all the time is spent in MaxWidth. |
Beta Was this translation helpful? Give feedback.
-
Testing done; results spectacular. Testing on an AMD mini pc with a mobile 4 core (Ryzen 7 3750H), Windows 11, Delphi 11, 32bit and 64bit. I see the new routine being roughly 4 times faster in every test I tried. Here are the logs. New and Old are the new routine vs the pre-parallel routine. Res is just the maxwidth calculated. The first pair is a 36 meg on disk script file with 3 hundred thousand lines of the same string (I wanted to do a test where all the lines were the same length to see what affect that might have). The second pair is the 250K bracketed SQL file I've mentioned before. The third par is a largish .pas file. I haven't tested "long line" files mentioned above. I'll give that a try and see what the difference is. [Update- These tests are without any syntax highlighting. Single line testing shows almost the exact same timings between the parallel and non-parallel version, which makes sense.] So far, I'd say this change is a win!
|
Beta Was this translation helpful? Give feedback.
-
I created a test file that looks like: File loads very quickly (less than a second.) Moving the caret through the characters is very interesting. Left and right arrowing at the top line shows about a second delay between each move. Careting down gets faster with every line, when on the last lines careting is back to normal. My use case for working with super wide files is usually opening a file, realizing it's just a single long line and doing a search and replace all of some delimiter with that delimiter and a CRLF to make the file normal. This is not in debug mode btw. |
Beta Was this translation helpful? Give feedback.
-
@DGH2112 @MShark67 |
Beta Was this translation helpful? Give feedback.
-
@MShark67 I wonder whether you can compare the performance of this vs the previous version. Many thanks! |
Beta Was this translation helpful? Give feedback.
-
Major commit.
|
Beta Was this translation helpful? Give feedback.
-
@MShark67
I have introduced a parallel for loop (from System.Threading) in the calculation of MaxWidth. Could you please test it with you 250K file and check whether it makes a difference in performance?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions