Mike Torrettinni
Members-
Content Count
1509 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Mike Torrettinni
-
Help with string extraction function
Mike Torrettinni replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Ok, I misunderstood your reaction. All good now 🙂 -
Help with string extraction function
Mike Torrettinni replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Yes, I agree. Or, this would be most commented function, as I would probably need to comment in details every other line 🙂 -
Help with string extraction function
Mike Torrettinni replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
I thought my first post shows my level of Delphi expertise. If it was expected from me to implement all the suggested new functions, benchmark on real data and report if any of them are bottlenecks... in less than 24h, then I'm clearly way over my head in this topic. It started such a nice topic, practice for me, discovering new approaches, so I feel bad that I mislead you on the purpose. Perhaps admin should delete this topic so nobody else gets mislead. -
Help with string extraction function
Mike Torrettinni replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Wait, this all happened yesterday... sorry, but I can't implement improvements so fast. What happened here, miscommunication? -
Help with string extraction function
Mike Torrettinni replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
No, not using any of it, yet. Planning to do some profiling and benchmarking on real data and will see if there are any bottlenecks in this area. -
Help with string extraction function
Mike Torrettinni replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Interesting stuff: asm, registries, aligning... it's like a black-box to me. Reading how little insignificant changes (order of functions calls) affect the performance, is kind of scary. But it shows how real performance optimization is based on case by case. It's hard (or impossible) to make 1 super performant algorithm for all cases. Just from this thread we can see the differences on optimization for short vs long strings, or like @aehimself pointed out if we need to consider nested brackets, escaped chars, quoted chars... Here I am thinking if increasing char pointer is faster than using integer iterator, while you guys are discussing condition branching and using stack and full set of registries 🙂 -
Help with string extraction function
Mike Torrettinni replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
If I look at PosEx code in System.pas it also walks char by char. No? @Attila Kovacs solutions uses Move, but not PosEx. You think PosEx could be better option for longer texts? -
Help with string extraction function
Mike Torrettinni replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Oh, you used GoTo... brave man 🙂 It is fastest fuction so far 🙂 -
Help with string extraction function
Mike Torrettinni replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Wow, I hope they fix this by 10.5. I'm skipping 10.4 anyway. -
Help with string extraction function
Mike Torrettinni replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
OK, this one is 25% faster, pretty good! -
Help with string extraction function
Mike Torrettinni replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
I'm testing for speed performance with this text example: Contrary to popular belief, {Lorem Ipsum} is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. {Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of} "de Finibus Bonorum et {Malorum" (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of} Lorem Ipsum, {"Lorem ipsum dolor sit amet.."}, comes from a line in section 1.10.32. 1mio iterations: Stopwatch := TStopwatch.StartNew; for i := 1 to 1000000 do ExtractContent5(s); Stopwatch.Stop; Memo5.Lines.Add(stopwatch.ElapsedMilliseconds.ToString); -
Help with string extraction function
Mike Torrettinni replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
No significant change, some runs it's a little slower (1587ms vs 1610ms). Wasn't really looking for speed performance, but it would be nice. -
Help with string extraction function
Mike Torrettinni replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Actually RegEx was accepted answer in that SO question. But I'm staying away from RegEx as much as possible. -
Help with string extraction function
Mike Torrettinni replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
New function is only about 17% faster than original - my simple tests. I was hoping that using pointers and all the changes would result in bigger performance gain. I agree. This was more exercise for me and trying new things. -
Help with string extraction function
Mike Torrettinni replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Thank you, looks good to me! 🙂 -
Help with string extraction function
Mike Torrettinni replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Aha, it can go past the #0 if missing closing bracket. This is better right: function ExtractContent3(const S: string): string; var p, r: pchar; begin SetLength(Result, S.Length); r := @Result[1]; p := @S[1]; while p^ <> #0 do begin if p^ = '{' then begin while p^ <> '}' do if p^ = #0 then begin sleep(0); Break; end else Inc(p); if p^ = #0 then // if inner loop gets to the end Break else Inc(p); end; r^ := p^; Inc(r); Inc(p); end; SetLength(Result, r - @Result[1]); end; -
Help with string extraction function
Mike Torrettinni replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Hm, I guess I can't see the bug... and it works. Any hints on the bug? -
Help with string extraction function
Mike Torrettinni replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Let me try. -
My first post here is describing Embarcadero's focus on Enterprise customers - keeping current, engaging them to keep Delphi alive, add new developers, multi-platform solutions... of course the whole engagement trickles down to smaller ISV, single developers, but not really focused on new developers. I assume majority of engaged developers on this site are part of smaller Delphi teams or individuals, so the expectations and observations are of course different. I wish I was wrong and we have a generation of new Delphi developers, but perhaps Community edition, Academy and other activities could slowly add a few of them, but their main focus doesn't seem to be new developers.
-
Well, we see these things differently. I see the progress, the changes - I like all the buzz being created around Delphi. We could argue the effectiveness, but compared to prior Idera times... I welcome the changes. And Embarcadero is software company, there are some limitations on how marketing to attract new customers is effective with software products vs the cost of it.
-
Compared to 10 years ago, they definitely increased their online presence, just look at the website. The email campaigns have become annoying especially before new releases, but seems they are better coordinate across offices. Cool App competition, online academy, t-shirt design contest, ... I don't remember were they doing all this prior 2015?
-
Well, if you look at Idera management team, it's very obvious Delphi is just part of investment portfolio. So, yes, money first, everything else second. What they achieved in 5 years since acquiring Embarcadero, related to Delphi/RAD Studio - I assume it applies to many other tools: - increase price as much as possible (it's staying below $7K, which is a sort of wide range Enterprise limit) -> maximize revenue from Enterprise customers - Done - full subscription business model -> lock Enterprise customers - Done - multi-platform -> lock enterprise customers - Done - implement market place - they tried, but realized they are 15 years too late -> GetIt is best they could do in current Delphi market - improve marketing, sales channels - I think we can all agree that they are doing a lot in this area, in some ways more successful than others - ... and many more that focus on Enterprise customers first I'm sure these checks are part of the strategy that lead to next step: sell Embarcadero (or just RAD Studio). And I think this is going to happen in next 3 years. Now, the good thing is that one of the focus points that are left, is quality. So, good things are coming 🙂
-
Just discovered: IDE shows 'matches found' for search :)
Mike Torrettinni posted a topic in Delphi IDE and APIs
Wow, this is pretty great! I don't know how many years, versions this has been implemented for, but I really like it! Very useful for large units, no more counting! 🙂 -
Aha, OK. English is not first language, so sometimes I can be a bit off the mark.
-
You think start /wait project1.exe is not best solution for my problem? Better suggestion?