Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 05/24/23 in all areas

  1. Ian Branch

    Message Broker??

    Hi Team, D11.3. I have an App that populates the captions of two labels. It all works fine. What I would like to do is make this captions availabe to other Apps rather than regerating them in the other Apps. All the Apps are on a Windows 2012 Server. Multi-User. Some of the Apps may be running via RDP, the same and other Apps may be running via LAN, i.e. called from the Server and running physically on the User's PC. Users are using Win 7 & Win 10 workstations. The generating App may be being used at any time by many Users. The term Message Broker came to my mind and IIRC there was something by one of the inhabitants of this Forum that might be my solution. Can somebody refresh my memory and point me in the correct direction please? Or, alternatives. The simpler the better. 🙂 Regards & TIA, Ian
  2. Anders Melander

    MAP2PDB - Profiling with VTune

    Yes, it definitely should. I'm just too tired to dissect the file in a hex editor right now 🙂 Maybe later tonight.
  3. The hack with the @ operator works only in Win32, but Win64 has different calling conventions. Use a global function for the Sort method (matching the signature) instead of a local one (which does not).
  4. It's not TList<T> from System.Generics.Collections. It's the age-old TList from System.Classes. Straight from the documentation: System.Classes.TList.Sort - RAD Studio API Documentation (embarcadero.com)
  5. The first thing I would try is to delete the DPROJ file (after making a backup, of course) and the open the DPR file for the project (with NO project group open) to force the IDE to recreate the DPROJ file. Unless you have exactly duplicated the folder structure on the new PC the project file may contain references to pathes that do not exist on your new PC. The error message seems to come from one of the layout components, perhaps a TGridPanel. If you get it when creating a new VCL project with an empty form it has to come from the IDE itself, perhaps from a loaded 3rd-party package or expert.
  6. mikerabat

    Fast Base64 encode/decode

    I just released an assembler optimzed (AVX2 set) Base64 encoding/decoding unit. check it out under https://github.com/mikerabat/fastbase64/ My reference implementation achieves up to 10 times speedup against the reference Indy implementation. Let me know what you think or if you encounter some errors...
  7. Fr0sT.Brutal

    Message Broker??

    Seems you need some centralized storage of data where all other apps could connect. It could be some 3rd party server or your generator app. Server could be message broker (MQTT etc) or Redis or a light database or simple custom HTTP/REST server. What option you prefer depends on your setup: - is generator app constantly running so it could be server - is adding config of server address to all clients acceptable - what components are allowable Some message brokers include 0-conf server autodiscovery (I can't name exact implementations however)
  8. Mustafa ֍zgun

    Just open folder ( Android )

    Hi apps targeting Android 10 and higher are given scoped access into external storage, or scoped storage. Android 11 introduces changes and restrictions to enhance user privacy, including the following: Scoped storage enforcement: Access into external storage directories is limited to an app-specific directory and specific types of media that the app has created. Open files using the Storage Access Framework The SAF includes the following: Document provider: a content provider that lets a storage service, such as Google Drive, reveal the files it manages. A document provider is implemented as a subclass of the DocumentsProvider class. The document-provider schema is based on a traditional file hierarchy, though how your document provider physically stores data is up to you. The Android platform includes several built-in document providers, such as Downloads, Images, and Videos. Client app: a custom app that invokes the ACTION_CREATE_DOCUMENT, ACTION_OPEN_DOCUMENT, and ACTION_OPEN_DOCUMENT_TREE intent actions and receives the files returned by document providers. Picker: a system UI that lets users access documents from all document providers that satisfy the client app's search criteria. https://developer.android.com/static/images/providers/storage_picker.svg Access documents and other files from shared storage Sample project Delphi - Android Scoped Storage : Storage Access Framework SAF API
  9. Some of us would notice this immediately because we make a concerted effort to minimize Hints and Warnings that the compiler produces. But for those who aren't so inclined, it's just another bit of noise to be ignored.
  10. Stefan Glienke

    MAP2PDB - Profiling with VTune

    No, it's not - it's the call from this line: https://github.com/microsoft/microsoft-pdb/blob/master/PDB/msf/msf.cpp#L1627 It however might look different today given that source on GitHub is from seven years ago but it might still give a clue. The weirdest way I got a "thank you" ever ngl
  11. Anders Melander

    MAP2PDB - Profiling with VTune

    I want a sex change operation so I can have your children. (it means "thank you" in case you wondered)
  12. Anders Melander

    Fast Base64 encode/decode

    Maybe at least reformat it into two distinct columns {$IFDEF DELPHIAVX}vpshufb ymm1, ymm0, [r9 + TAVXEncodeConst.Lut0];{$ELSE}db $C4,$C2,$7D,$00,$49,$20;{$ENDIF} {$IFDEF DELPHIAVX}vpand ymm2, ymm1, [r9 + TAVXEncodeConst.Mask0];{$ELSE}db $C4,$C1,$75,$DB,$51,$60;{$ENDIF} {$IFDEF DELPHIAVX}vpand ymm1, ymm1, [r9 + TAVXEncodeConst.Mask2];{$ELSE}db $C4,$C1,$75,$DB,$89,$A0,$00,$00,$00;{$ENDIF} {$IFDEF DELPHIAVX}vpmulhuw ymm2, ymm2, [r9 + TAVXEncodeConst.Mask1];{$ELSE}db $C4,$C1,$6D,$E4,$91,$80,$00,$00,$00;{$ENDIF} {$IFDEF DELPHIAVX}vpmullw ymm1, ymm1, [r9 + TAVXEncodeConst.Mask3];{$ELSE}db $C4,$C1,$75,$D5,$89,$C0,$00,$00,$00;{$ENDIF} {$IFDEF DELPHIAVX}vpor ymm1, ymm1, ymm2;{$ELSE}db $C5,$F5,$EB,$CA;{$ENDIF} Like this: {$IFDEF DELPHIAVX} vpshufb ymm1, ymm0, [r9 + TAVXEncodeConst.Lut0]; {$ELSE}db $C4,$C2,$7D,$00,$49,$20;{$ENDIF} {$IFDEF DELPHIAVX} vpand ymm2, ymm1, [r9 + TAVXEncodeConst.Mask0]; {$ELSE}db $C4,$C1,$75,$DB,$51,$60;{$ENDIF} {$IFDEF DELPHIAVX} vpand ymm1, ymm1, [r9 + TAVXEncodeConst.Mask2]; {$ELSE}db $C4,$C1,$75,$DB,$89,$A0,$00,$00,$00;{$ENDIF} {$IFDEF DELPHIAVX} vpmulhuw ymm2, ymm2, [r9 + TAVXEncodeConst.Mask1]; {$ELSE}db $C4,$C1,$6D,$E4,$91,$80,$00,$00,$00;{$ENDIF} {$IFDEF DELPHIAVX} vpmullw ymm1, ymm1, [r9 + TAVXEncodeConst.Mask3]; {$ELSE}db $C4,$C1,$75,$D5,$89,$C0,$00,$00,$00;{$ENDIF} {$IFDEF DELPHIAVX} vpor ymm1, ymm1, ymm2; {$ELSE}db $C5,$F5,$EB,$CA;{$ENDIF} or even better: {$IFDEF DELPHIAVX} vpshufb ymm1, ymm0, [r9 + TAVXEncodeConst.Lut0]; {$ELSE}db $C4,$C2,$7D,$00,$49,$20;{$ENDIF} {$IFDEF DELPHIAVX} vpand ymm2, ymm1, [r9 + TAVXEncodeConst.Mask0]; {$ELSE}db $C4,$C1,$75,$DB,$51,$60;{$ENDIF} {$IFDEF DELPHIAVX} vpand ymm1, ymm1, [r9 + TAVXEncodeConst.Mask2]; {$ELSE}db $C4,$C1,$75,$DB,$89,$A0,$00,$00,$00;{$ENDIF} {$IFDEF DELPHIAVX} vpmulhuw ymm2, ymm2, [r9 + TAVXEncodeConst.Mask1]; {$ELSE}db $C4,$C1,$6D,$E4,$91,$80,$00,$00,$00;{$ENDIF} {$IFDEF DELPHIAVX} vpmullw ymm1, ymm1, [r9 + TAVXEncodeConst.Mask3]; {$ELSE}db $C4,$C1,$75,$D5,$89,$C0,$00,$00,$00;{$ENDIF} {$IFDEF DELPHIAVX} vpor ymm1, ymm1, ymm2; {$ELSE}db $C5,$F5,$EB,$CA;{$ENDIF} Unreadable code is unmaintainable.
  13. Stefan Glienke

    Fast Base64 encode/decode

    Personally, I would find it way more readable if you would not ifdef DELPHIAVX for every single line but simply make it two blocks, one using the avx instructions and one using db.
  14. Bogdan Grabinski

    64 bit PostgreSQL and Embarcadero ???

    Thank you fellow programmers for the help. I managed do have path to 32 bit libpq.dll using FDPhysPgDriverLink->VendorLib This way I have active VCL components with connection to Postgresql server that is 64 bit ( version 14.1 on windows 10). Basic functionality works, as to more adventured as Json data type, I have not tested. Before I compile I have to change the property of FDPhysPgDriverLink->VendorLib to have path to 64 bit version of libpq.dll The Embarcadero manual for how to connect to postgresql is not very helpful (old,not tested with new database). The list if dll's I used is larger then in manual as well. I will describe all details after more testing. As of now I have not found where in code to change the property of FDPhysPgDriverLink->VendorLib so it will work for runtime. PS. I installed Lazarus 2.2.0 and connected postgresql as well.
  15. Anders Melander

    MAP2PDB - Profiling with VTune

    Fixed the problem where some symbols (in particular generics) either resolved to the calling unit or to a wrong line number in the implementing unit. Thanks to @Stefan Glienke for pestering me about this until it got solved. Source committed and binary uploaded. And now... Pizza! 🍕
  16. Vincent Parrett

    MAP2PDB - Profiling with VTune

    I just had my first big win with VTune 😃 I was looking into improving the performance of loading projects in FinalBuilder 9 (in dev) - we have some customers with huge projects that were taking a while to load. Profiling with VTune showed that most of the time was spent in the project lexer/parser - the lexer created class based tokens (and some other associated classes) and a lot of time was spent in the lexer and the memory manager. So 3 hours later, the code has been converted to use records rather than classes - the unit tests all pass (I only had to comment out all the Assert.IsNotNull(token); calls) and the application runs normally (still need to code review to make sure I didn't break things). The result is around a 30% improvement with that change alone! That's just me counting out loud as the project loads 😉 - I'll do more formal timing/testing tomorrow. I also just compared to FinalBuilder 8 and the total improvement is more like 60% - I'll put that down to some manual code review looking for possible hotspots over the last week, and also to switching from the rtl generic collections to using spring4d everywhere! Time for some sleep, but looking forward to more VTuning tomorrow. Thanks @Anders Melander again for this amazing bit of work!
  17. Vincent Parrett

    MAP2PDB - Profiling with VTune

    Agree, there is already a few issues asking for pdb support that have lots of votes and have been open for years. @Marco Cantu @David Millington FYI.
  18. Vincent Parrett

    MAP2PDB - Profiling with VTune

    Well that's what happens when you strip the team down to the bare bones and then hire short term contractors, maintaining things becomes a problem when your teams domain knowledge is low. FWIW, 5 minutes in and I already fixed a perf issue in the area that I have been trying to optimise for the last week (replaced a list with a hashset) - a small win but I'll take any win I can get right now😃 Pity embarcadero don't ship map files for their bpl's - hmmm will log a qc for that - because as I dig deeper into my perf issues I end up in the weeds in rtl etc with func@xxx a lot.
  19. Vincent Parrett

    MAP2PDB - Profiling with VTune

    It wasn't that, and I probably did forget the bind switch before I sent it to you, however with the new version.... we have lift off! Awesome work! E:\map2pdb>map2pdb.exe I:\FBAT_HG9\Output\FB9\FinalBuilder9.map -v -bind:I:\FBAT_HG9\Output\FB9\FinalBuilder9.exe map2pdb - Copyright (c) 2021 Anders Melander Version 2.0 Constructed a new PDB GUID: {CE1E6D08-67E6-4B5B-B42A-3FC719254F1E} Output filename not specified. Defaulting to FinalBuilder9.pdb Reading MAP file - Segments Warning: [ 8] Empty segment: .pdata [0006:00400000] - Modules - Symbols Warning: [20671] Failed to resolve symbol to module: [0005:00000608] SysInit.TlsLast Warning: [20673] Failed to resolve symbol to module: [0004:FF77A000] SysInit.__ImageBase - Line numbers Warning: [71563] Line number with zero offset ignored. Module:VSoft.IDE.Types, Segment:0001, Source:VSoft.IDE.Types.pas, Line:49 Warning: [71567] Line number with zero offset ignored. Module:VSoft.IDE.Interfaces, Segment:0001, Source:VSoft.IDE.Interfaces.pas, Line:328 Warning: [75481] Line number with zero offset ignored. Module:LMDRTLConst, Segment:0001, Source:LMDRTLConst.pas, Line:213 Warning: [75621] Line number with zero offset ignored. Module:intfLMDBase, Segment:0001, Source:intfLMDBase.pas, Line:44 Warning: [76980] Line number with zero offset ignored. Module:LMDDckCst, Segment:0001, Source:LMDDckCst.pas, Line:29 Warning: [79649] Line number with zero offset ignored. Module:VSoft.IDE.ActionListInterfaces, Segment:0001, Source:VSoft.IDE.ActionListInterfaces.pas, Line:136 Warning: [90056] Line number with zero offset ignored. Module:SynEditStrConst, Segment:0001, Source:SynEditStrConst.pas, Line:577 Warning: [98436] Line number with zero offset ignored. Module:VSoft.IDE.WizardManagerService, Segment:0001, Source:VSoft.IDE.WizardManagerService.pas, Line:61 Warning: [99799] Line number with zero offset ignored. Module:dwTaskbarList, Segment:0001, Source:dwTaskbarList.pas, Line:213 Warning: [103835] Line number with zero offset ignored. Module:RestException, Segment:0001, Source:RestException.pas, Line:26 Warning: [105461] Line number with zero offset ignored. Module:VSoft.Shared.UXLControlIntf, Segment:0001, Source:VSoft.Shared.UXLControlIntf.pas, Line:60 Warning: [107033] Line number with zero offset ignored. Module:VSoft.IDE.MS.ActionCollection.Interfaces, Segment:0001, Source:VSoft.IDE.MS.ActionCollection.Interfaces.pas, Line:1085 Constructing PDB file - Collecting source file names - Module streams - Strings stream - PDB Info stream - TPI stream - Symbols stream - DBI stream - IPI stream - Finalizing PDB file Patching PE file - PE32 image (32-bit) - PDB file name has been stored in debug data. - Header checksum has been cleared. - PE file has been updated. I was also able to create a pdb for the package E:\map2pdb>map2pdb.exe I:\FBAT_HG9\Output\FB9\VSoft.Core.map -bind:I:\FBAT_HG9\Output\FB9\VSoft.Core.bpl -v map2pdb - Copyright (c) 2021 Anders Melander Version 2.0 Constructed a new PDB GUID: {76323C0F-0787-44F8-BC72-2B6ACC9CBF82} Output filename not specified. Defaulting to VSoft.Core.pdb Reading MAP file - Segments Warning: [ 7] Empty segment: .tls [0005:00000000] Warning: [ 8] Empty segment: .pdata [0006:00400000] - Modules Warning: [ 1682] Module exceed segment bounds - ignored: OtlCommon.Utils [0005:00000000+256] - Symbols Warning: [ 6403] Failed to resolve symbol to module: [0005:00000000] OtlCommon.Utils.LastThreadName Warning: [ 8705] Failed to resolve symbol to module: [0005:00000100] SysInit.TlsLast Warning: [ 8709] Failed to resolve symbol to module: [0004:FFBF8000] SysInit.__ImageBase - Line numbers Warning: [64147] Line number offset out of range for module. Offset:003DAEEF, Module:.VSoft.Core [003DAEF0 - 003E5738] Constructing PDB file - Collecting source file names - Module streams - Strings stream - PDB Info stream - TPI stream - Symbols stream - DBI stream - IPI stream - Finalizing PDB file Patching PE file - PE32 image (32-bit) - PDB file name has been stored in debug data. - Header checksum has been cleared. - PE file has been updated. Now to hook it into every project in the group and see how it goes 😃 Thanks again for this awesome effort.. my only question now is, if you can do this in your spare time, why TF can't embarcadero do it 🙄
  20. Anders Melander

    MAP2PDB - Profiling with VTune

    The problem with your map file was just that my validation was a bit too aggressive. I've now turned some of the errors into warnings. New version uploaded. One of the problems was that I discarded zero size segments. E.g. the TLS segment: 0005:00000000 00000000H .tls TLS which meant that later on when a module or symbol tried to resolve segment #5 that turned into an error. Detailed map of segments 0005:00000000 00000100 C=TLS S=.tls G=(none) M=OtlCommon.Utils ACBP=A9 Address Publics by Name 0005:00000000 OtlCommon.Utils.LastThreadName 0005:00000100 SysInit.TlsLast I'm not not really sure of how I should handle these out of bounds situations. Right now I just warn about them and then ignore the module/symbol/line. I think you just forgot the -bind switch. Your project3.exe did not contain a reference to project3.pdb. After I run map2pdb -bind project3,map I got VTune to resolve with your exe. You're probably hitting the 16Mb limit, I'm now outputting a warning so we're aware of it when it happens. I was planning on adding support for PE32+ (64-bit) next but I guess solving the MSF/16Mb problem is more important. I can't really use it myself for anything serious until that's done.
×