Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 06/05/21 in all areas

  1. Wil van Antwerpen

    Using VMWare: what files remain on host?

    Also using everything VMware down here. All of my code and setup is in a VM. If I need to share source with other VM's or host then that is done via source control. Note that VMware shared folders (hgfs) can work for sharing source with host, but if it has a lot of files then I do expect a decreased performance while compiling. Shared folders are convenient, but they are also known for not being very performant. This is a common complaint at the VMware Forums. My recommendation in that case is to use network shares as they tend to be faster. Another thing to look into when troubleshooting performance issues with VMware shared folders is to make sure you antivirus is not checking your source.
  2. Mahdi Safsafi

    Help with string extraction function

    @Kas Ob. I noticed that you take optimization very seriously. That's really good but just as an advice from someone that did, don't be driven too much. Behind that optimization door resides the evil ! In fact, I spent much time reading Intel doc/books, comparing different compilers (gcc, clang, ...). At the end I become more obsessional and less productive as I started paying much attention to my codes than what is required like taking some time to decide whether I should write if a = b or if a <> b.
  3. Attila Kovacs

    Help with string extraction function

    no-no, the compiler runs out of registers if do so, always testing separately Nice routine. I don't know why but if you use parameters instead if consts it performs even better. (Despite comparing against the stack) ExtractContent(const S: string; const aChar1, aChar2: Char); this boost it even further: var zero: Char; zero := #0; until (P^ = aChar2) or (P^ = zero); or even better: until (P^ = aChar2) or (P = ep);
  4. Stefan Glienke

    Help with string extraction function

    @Kas Ob. Your benchmark is flawed - every time you test multiple implementations in the same test you have a bias because of sorts of things such as memory layout/alignment, branch prediction, prefetcher and so on. For example when I run the code you posted "Kas not fixed wins" - when I comment out all others the code runs slower. When I comment out one of the tests all routines suddenly run faster. This clearly is an indicator that depending on where the code is put by the compiler sometimes they might be sitting in the cache more beneficial than some other times. Unfortunately at least to my knowledge with the Delphi compiler you have no control over code alignment - unless you write stuff in asm if course...
×