Jump to content

Mike Torrettinni

Members
  • Content Count

    1509
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by Mike Torrettinni

  1. Mike Torrettinni

    Help with string extraction function

    Ok, I misunderstood your reaction. All good now 🙂
  2. Mike Torrettinni

    Help with string extraction function

    Yes, I agree. Or, this would be most commented function, as I would probably need to comment in details every other line 🙂
  3. Mike Torrettinni

    Help with string extraction function

    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.
  4. Mike Torrettinni

    Help with string extraction function

    Wait, this all happened yesterday... sorry, but I can't implement improvements so fast. What happened here, miscommunication?
  5. Mike Torrettinni

    Help with string extraction function

    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.
  6. Mike Torrettinni

    Help with string extraction function

    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 🙂
  7. Mike Torrettinni

    Help with string extraction function

    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?
  8. Mike Torrettinni

    Help with string extraction function

    Oh, you used GoTo... brave man 🙂 It is fastest fuction so far 🙂
  9. Mike Torrettinni

    Help with string extraction function

    Wow, I hope they fix this by 10.5. I'm skipping 10.4 anyway.
  10. Mike Torrettinni

    Help with string extraction function

    OK, this one is 25% faster, pretty good!
  11. Mike Torrettinni

    Help with string extraction function

    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);
  12. Mike Torrettinni

    Help with string extraction function

    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.
  13. Mike Torrettinni

    Help with string extraction function

    Actually RegEx was accepted answer in that SO question. But I'm staying away from RegEx as much as possible.
  14. Mike Torrettinni

    Help with string extraction function

    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.
  15. Mike Torrettinni

    Help with string extraction function

    Thank you, looks good to me! 🙂
  16. Mike Torrettinni

    Help with string extraction function

    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;
  17. Mike Torrettinni

    Help with string extraction function

    Hm, I guess I can't see the bug... and it works. Any hints on the bug?
  18. Mike Torrettinni

    Are we just "Cash Cows"?

    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.
  19. Mike Torrettinni

    Are we just "Cash Cows"?

    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.
  20. Mike Torrettinni

    Are we just "Cash Cows"?

    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?
  21. Mike Torrettinni

    Are we just "Cash Cows"?

    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 🙂
  22. 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! 🙂
  23. Mike Torrettinni

    Problem with ExitCode

    Aha, OK. English is not first language, so sometimes I can be a bit off the mark.
  24. Mike Torrettinni

    Problem with ExitCode

    You think start /wait project1.exe is not best solution for my problem? Better suggestion?
×