Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 03/18/21 in all areas

  1. Hello, this is the announcement that I just re-released a classic Delphi component called TComPortDrv. The new release is in agreement of the original author and the license was changed to Apache 2.0 by this. What is this non-visual VCL component about? It is an encapsulation of the Windows RS232 API so you can send and receive data via real and virtual COM-ports. The new version works from 10.4.1 Sydney onwards (due to the use of $(Auto) for the LibSuffix setting of the packages. You should get it compile on older versions though as well. Where can I get it from? https://github.com/MHumm/ComPortDriver/releases/tag/V3.0 What got changed in this V3.0 * made compilable with Unicode Delphi * fixed a severe bug in the data receive event which would overflow the internal buffer when using this component with a high baudrate (over 230400) * changed all external comments to XMLDOC * added a method to get a list of available COM-ports (only as COM3, COM4 etc. as of now) * added SetCommBreak and ClearCommBreak methods * made DelayForRX function a method now and based its calculation on the current serial settings * changed the component Icon Enjoy TurboMagic
  2. TurboMagic

    New/old component re-released: TComPortDrv

    Thanks for notifying me. Fixed now, so you can enjoy it now 😉
  3. First because 64bit does not suffer from the "virtual method glitch". Second because even with a class implementing the IComparer interface you get adjustor thunks which you don't have with the default comparers provided by Generics.Collections.Defaults because those are directly crafted IMTs (interface method tables) BTW: you again unnecessarily slow down your benchmark results by putting everything into the dpr main. And you are comparing different things - your CustomBinarySearch uses CompareValue which is a function call. So if you decide to roll your custom implementation then don't dumb it down: function GetName_CustomBinarySearch2(const aData: TArray<TDataLine>; const aItem: TDataLine): string; var L, H, i, c: Integer; begin L := 0; H := High(aData); while L <= H do begin i := L + (H - L) shr 1; c := aData[i].SeqNo - aItem.SeqNo; if c < 0 then L := i + 1 else if c > 0 then H := i - 1 else Break; end; if L <= H then Result := aData[i].CustomName else Result := ''; end; makes it almost twice as fast as your implementation. I decided to use the subtract approach as you did with the comparers - keep in mind this only works if there cant be an overflow which wont happen if SeqNo is just 0..MaxInt Anyhow at least in this benchmark it did not make any noticable difference to writing: if aData[i].SeqNo < aItem.SeqNo then L := i + 1 else if aData[i].SeqNo > aItem.SeqNo then H := i - 1 else Break;
  4. miab

    Zeos 7.3 entered the beta phase.

    ZEOS 8.0.0 (trunk) svn 7386 Works with: Lazarus 2.0.12(fpc 3.2.0) NEW: TryKeepDataOnDisconnect - possibility to work without connection to the server https://zeoslib.sourceforge.io/viewtopic.php?f=50&p=168409#p168409 https://sourceforge.net/projects/zeoslib/ https://github.com/marsupilami79/zeoslib There have been a few fixes. Feel free to download, testing, use, submit comments. Michał
  5. Kas Ob.

    Profiler for Delphi

    Few thoughts and information on this This what i did in the past by finding the smallest pdb file and reverse engineering it, but it was for a plugin on a debugger, the debugger got an update broke the plugin and then the plugin got an update with newer pdb version and nothing working anymore, that is not point now, it seems Microsoft is sticking to RSDS for now. VTune works and show perfectly debug information of binaries generated by FPC, while the debug information in FPC are DWARF format, VTune can handle the internal debug information and the FPC external file which have ".dbg" extension, so if you need an easy an easy to manipulate debug information then FPC is your friend for now. Which does work perfectly and here is the thing, CodeView is different format from DWARF, but this tool supports DWARF also, so the FPC "dbg" files can be perfectly converted with this tool into 100% working with VTune "pdb" file, it also patch the exe. combine the two above and you have an easy way to build pdb files that you fully control. Also, external dbg DWARF files are attached to an exe differently from pdb files, it is an extra PE section with out of size additional few bytes starting with the size of these bytes which is $13 represented as 32bit little integer then ".gnu_debuglink" followied by 0, while the section is simply contain the dbg file name as 0 terminated string followed by its CRC32 checksum,(one look at the exe hex and you will understand it it) and that is it, here i want to mention when i removed that dbg file VTune searched for (EXEname).pdb automatically even though there is no pdb debug information in the header, this might be useful to exploit, (who knows ?). The above screenshot are using FPC with external dbg files ( the internal debug information has the same result ), the following screenshot made after dbg converted to pdb using cv2pdb You can see the converted one is better for the stack information, which is strange !, but yet it does show that addresses format play essential rule here. So , i think VTune is reading and parsing your pdb file, but there is something wrong with RVA's and these should be adjusted accordingly, simple like that. Also the MAP files data are relative to the PE section, so it is plausible cause. Another also, i witnessed many discrepancies in MAP files like repeated entries ( the same relative address with the same exact procedure name allocated in different places even within the same MAP section), this might be also the case that your converted pdb fil contains repeated data that is triggering an no-go check for VTune in case it is building hash table for an addresses with a names, may be it is the case. Hope that help.
  6. No library used, just a simplest implementation of hash map. Use it as you need. I'm hearing about this the first time ever, and it seems to me very strange. Also, a single hash map can be organized on top of TDataLine user objects without any additional objects (via additng Next and Hash fields directly to TDataLine). Two maps, however will need another one pair of such properties, which is not so graceful, but also possible, if we speak about the extreme case. I've only tested with 100k items. I can see the effect. However, it's not clear for me why this happens.
  7. Some very impressive numbers, x32 and x64!
  8. Here is my try. I've changed a lot in existing code (mentioned early comparers, equality comparers, etc.). Also, I've replaced returned string type in functions by PString, just because otherwise string handling takes too much time and algorythms comparison becomes not interesting. As well I've added my own minimalistic implementation of hash maps (not universal). mapstest.zip
  9. Vincent Parrett

    Profiler for Delphi

    Don't stop now.. we're all here waiting for the exciting news (and screenshots) 😉. I've long been envious of devs who were able to use vtune (and other tools which didn't support delphi ) - this would be massive if you pull it off!
  10. KodeZwerg

    IsElevated

    RunElevatedSupport.pas is what I use. Call IsElevated (Boolean) thats all you need to do. Also offers to elevate code pieces. I love it.
  11. Lars Fosdal

    10.4.2 IDE Compilation Memory leak

    I commented on this one. https://quality.embarcadero.com/browse/RSP-32768 https://quality.embarcadero.com/browse/RSP-32792 and 93 are duplicates of that one, it seems.
  12. miab

    Zeos 7.3 entered the beta phase.

    ZEOS 8.0.0 (trunk) svn 7339 Works from Delphi 7 to Delphi 10.4.2 Sydney (and Lazarus 2.0.12 - fpc 3.2.0) https://zeoslib.sourceforge.io/viewtopic.php?f=50&p=165990#p165990 https://sourceforge.net/projects/zeoslib/ https://github.com/marsupilami79/zeoslib There have been a few fixes. Feel free to download, testing, use, submit comments. Michał
  13. microtronx

    PaxCompiler

    Guys, have heard about htscripter from Delphihtlmcomponents? We are using it as runtime interpreter and it is working very good and stable plus it registers classes with only few lines of code (rtti) and the most important thing is: it is still developed and optimized by the developer. We have switched over from jvInterpreter! and it was a very good decision!
×