( t0 = timestamp() h0 = heapfree ss = filterstring strToCheck “\n” pt = “kappa*” ii = for k=1 to ss.count where matchpattern (trimleft ss[k] ” \t”)…
so is it not as simple as: ( t0 = timestamp() h0 = heapfree ss = filterstring strToCheck “\n” rx = dotnetobject “System.Text.RegularExpressions.Re…
Serejah: python is order of magnitude slower for this expression @”(^|\n|\r)\s*kappa” which matches lines starting with kappa oops… I seem to ha…
could you post (or send me) the file you are using for the test? (SampleText.txt) to measure performance we have to test the same source
I don’t see any reason to use Python… I’m pretty sure C# (dotnet) can do it just as fast.
ok… found… next(iterator, default) Retrieve the next item from the iterator by calling its next() method. If default is given, it is returned if the i…
I don’t know how to suppress “StopIteration” yielding yet… it needs some “wrapping” of python try/except.
something like this: ( t0 = timestamp() h0 = heapfree r = (re.finditer “\n” strToCheck) k = (re.finditer “kappa” strToCheck) y = 0 s = 0 i =…
as I said above, it’s very easy to get… just find ends of all lines first
the well-known issue kills performance – iterating of dotnet collections.
the pure MXS dotnet is not bad too: ( t0 = timestamp() h0 = heapfree matches = (dotnetclass “System.Text.RegularExpressions.Regex”).Matches strToC…
Serejah: compared to a wall of text needed for c# python is definitely a winner maybe (and very likely) we might have a memory issue with python…
it might be a smarter way, but I use the first that comes to mind: cmd = python.import “__builtin__” cmd.list k as array
re = python.import “re” ( t0 = timestamp() h0 = heapfree n = (re.finditer “\n” strToCheck) k = (re.finditer “kappa” strToCheck) o = (re.finditer “…
I’m pretty sure finding all occurrences is very fast if you only get the position. so I would first find all the positions of the end of the lines and…