Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 08/28/20 in all areas

  1. IconFontsImageList components by @Carlo Barazzetta could be the answer: you can explorer the complete wiki to see how it works. Summary of library: An IconFontsImageCollection component that inherits from Delphi's CustomImageCollection and is compatible with VirtualImageList A IconFontsVirtualImageList, to use with Delphi version older than 10.3 A rendering engine of Icon-fonts using GDI+ (from Delphi XE4) A complete backward compatibility with older Delphi versions (from Delphi 7) A useful Collection and Component editor, with support for Category of Icons A custom CharMap viewer, to easily select icons contained in any Font Support for changing the Color based on the active VCL Style. High performance of drawing engine Support for FMX (also for mobile platforms) It's free and open-source Icons based on Fonts are a good alternative to bitmaps because they need only the Font installed in the system to obtain thousands of images (like the "Material Design Font Desktop.ttf" font: https://github.com/Templarian/MaterialDesign-Font). The icons scales perfectly, so, you don't need to multiple resolutions of your images to match the DPI of the monitors and multiple colors for Theme used. The Collection of Icons can be rendered by a single Font/Color defined at collection level, or by different Fonts/Color defined at Icon level, so you can mix different icons from different Fonts in a single collection. The library is quite stable, but any contribution is welcome!
  2. Arnaud Bouchez

    a pair of MM test

    On Windows, we use http.sys kernel mode which scales better than anything on this platform. It is faster than IOCP since it runs in the kernel. On Linux, we use our own thread-pool of socket server, with a nginx frontend as reverse proxy on the unix socket loopback, handling HTTPS and HTTP/2. This is very safe and scalable. And don't trust micro benchmarks. Even worse, don't write your own benchmark. They won't be as good as measuring of a real application. As I wrote, Intel TBB is a no-go for real server work due to huge memory consumption. If you have to run some specific API calls to release the memory, this is a big design flow - may be considered as a bug (we don't want to have the application stale as it would have with a GC) - and we would never do it. To be more precise, we use long-living threads from thread pools. So in practice, the threads are never released, and the memory allocation and the memory release are done in diverse threads: one thread pool handles the socket communication, then other thread pool will consume the data and release the memory. This is a scenario typical from most event-driven servers, running on multi-core CPUs, with a proven ring-oriented architecture. Perhaps Intel TBB is not very good at releasing memory with such pattern - whereas our SynFPCx64MM is very efficient in this case. And we almost never realloc - just alloc/free using the stack as working buffer if necessary.
  3. aehimself

    how to run git commands from Delphi app

    It's pretty undocumented, but kind of easy to understand. Feel free to modify it to your needs: @ECHO OFF SET GITDIR=C:\LocalWork\_DelphiComponents SET OLDDIR=%CD% FOR /F "tokens=1 delims=" %%a IN ('DIR /B /A:D %GITDIR%') DO CALL :CHECK "%%a" GOTO :END :CHECK CD /D %GITDIR%\%~1 > nul 2>&1 IF ERRORLEVEL 1 GOTO :eof "C:\Program Files\Git\cmd\git.exe" fetch > nul 2>&1 IF ERRORLEVEL 1 GOTO :eof ECHO/|SET /P=%~1... "C:\Program Files\Git\cmd\git.exe" status > "%TEMP%\gitstatus.tmp" 2>&1 IF ERRORLEVEL 1 (ECHO querying status failed! & GOTO :DELEOF) TYPE "%TEMP%\gitstatus.tmp" | FIND /I "is behind" > nul 2>&1 IF ERRORLEVEL 1 (ECHO up to date. & GOTO :DELEOF) TYPE "%TEMP%\gitstatus.tmp" | FIND /I "nothing to commit, working tree clean" > nul 2>&1 IF ERRORLEVEL 1 (SET STASHED=1) ELSE (SET STASHED=0) IF %STASHED%==0 GOTO :PULL "C:\Program Files\Git\cmd\git.exe" stash > nul 2>&1 IF ERRORLEVEL 1 (ECHO could not stash changes! & GOTO :DELEOF) :PULL "C:\Program Files\Git\cmd\git.exe" pull --rebase > nul 2>&1 IF ERRORLEVEL 1 (ECHO could not download updates!) ELSE (ECHO update successful.) IF %STASHED%==0 GOTO :DELEOF "C:\Program Files\Git\cmd\git.exe" stash pop > nul 2>&1 IF ERRORLEVEL 1 ECHO could not restore changes! :DELEOF IF EXIST "%TEMP%\gitstatus.tmp" DEL "%TEMP%\gitstatus.tmp" GOTO :eof :END CD /D %OLDDIR% PAUSE For me it now outputted... All you have to do is to change the path to the folder, where your Git repositories are. The script will check all folders within the root and if it's a Git repository it will do it's work. If you need help, feel free to ask.
  4. Stefan Glienke

    Why is TList freed in this code?

    That's why IMultiMap<TKey,TValue> from Spring4d is so cool
  5. Arnaud Bouchez

    a pair of MM test

    TBB is fast in benchmarks, but from our experiment not usable on production on a server. TBB consumes A LOT of memory, much more than FM4/FM5 and alternatives. Numbers for a real multi-threaded Linux server are a show stopper for using TBB. On production on a huge Multi Xeon server, RAM consumption after a few hours stabilisation is gblic=2.6GB vs TBB=170GB - 60 times more memory ! With almost no actual performance boost. This mORMot service handles TB of incoming data, sent by block every second, with thousands of simultaneous HTTPS connections. See https://github.com/synopse/mORMot/blob/master/SynFPCCMemAligned.pas#L55 So never trust any benchmark. Try with your real workload. What we found out with https://github.com/synopse/mORMot/blob/master/SynFPCx64MM.pas may be interesting for the discussion. Using AVX for medium blocks moves/realloc doesn't change in practice in respect to an inlined SSE2 move (tiny/small/medium blocks), or a non-temporal move (using movntdq opcode instead of plain mov - for large blocks). For large blocks, using mremap/VirtualAlloc in-place reallocation is a better approach: relying on the OS and performing no move is faster than AVX/AVX2/AVX512. SynFPCx64MM is currently only for FPC. Used on production with heavily loaded servers. It is based on FastMM4 design, fully optimized in x86_64 asm, but with a lockless round-robin algorithm for tiny blocks (<=256 bytes), and an optional lockless list for FreeMem - which are the bottleneck for most actual servers. It has several spinning alternatives in case of contention. And it is really Open Source - not like FastMM5. We may publish a Delphi-compatible version in the next weeks.
  6. Darian Miller

    TEdit with enhanced keyboard support?

    Related StackOverflow topic: https://stackoverflow.com/questions/10305634/ctrlbackspace-in-delphi-controls (Be aware of side effects.) Some history on the topic: https://devblogs.microsoft.com/oldnewthing/20071011-00/?p=24823
  7. David Heffernan

    TEdit with enhanced keyboard support?

    Why don't you use the native Win32 TEdit but just enable CTRL+BACKSPACE? Call SHAutoComplete(WindowHandle, SHACF_AUTOAPPEND_FORCE_OFF or SHACF_AUTOSUGGEST_FORCE_OFF); in an overridden CreateWnd. Use an interposer, or some other mechanism to get this code to run.
  8. David Heffernan

    Why is TList freed in this code?

    Only cool for the users. Mind-bending if it's your job to implement it!
  9. David Heffernan

    Why is TList freed in this code?

    Also the owned objects are destroyed when items are removed from the dictionary. This is the same ownership model as the classic TObjectList.
  10. Lars Fosdal

    a pair of MM test

    A man in a hurry is always late.
  11. Fr0sT.Brutal

    how to run git commands from Delphi app

    I use Git from cmd and never call gitbash so no problem.
  12. Stefan Glienke

    a pair of MM test

    Thanks, might be worth putting that info into the github readme because right now this looks like the Sea*.dll are yours where no code nor their source is found for in the repo. Also apart from the raw speed numbers do you have total/peak memory allocated comparisons for the tests you mention as well? Edit: what is the "FastMM5 benchmark utility" you referring to? I see no benchmark in the FastMM5 repo
  13. RDP1974

    a pair of MM test

    5x quicker TParallel.For is from FastMM5 benchmark utility results DLL? Are from Intel libs, I did only wrappers are plain, optimized config, compiled dll from Intel TBB and IPP royalty free packages, no custom source code changes are done you can compile by yourself, I have put them in the repository because many people cannot build them, or not having the time https://github.com/oneapi-src/oneTBB/releases https://github.com/oneapi-src/oneTBB/archive/v2020.3.zip -> see folder TBBMalloc for the RTL simd patches: https://software.seek.intel.com/performance-libraries -> IPP run the utility to build a custom DLL and export: 'ippsZero_8u'; 'ippsCopy_8u'; 'ippsMove_8u'; 'ippsSet_8u'; 'ippsFind_8u'; 'ippsCompare_8u'; 'ippsUppercaseLatin_8u_I'; 'ippsReplaceC_8u'; for the ZLIB acceleration (3x-5x quicker than windows gzip, webbroker helper provided)-> extract IPP under Linux, see the readme how to patch zlib, take the patched sources and compile them with MS VC++ kind regards R. btw. I use them from a pair of years with my customers, never had a trouble
  14. Stefan Glienke

    a pair of MM test

    X is n times faster than Y is not leading anywhere unless you profile the bottleneck of Y in your benchmark. Run it under VTune or uProf and report your findings. As for your MM it might be faster but nobody serious will download and use some random dlls (that are not even signed) from the internet and put them into production.
  15. Darian Miller

    how to run git commands from Delphi app

    You could research how the Delphi IDE handles GIT commands for its integration. https://sourceforge.net/p/radstudioverins/code/HEAD/tree/branches/git-hg/gitide/
  16. aehimself

    how to run git commands from Delphi app

    No. Git bash is just an alternate shell to cmd with Linux-like commands. Yo can run git from your old and rusty cmd directly (ShellExecute / CreateProcess from Delphi) and it will work just as good as from Git Bash. I have a .cmd file to check all of my local git repositories and if there is an update upstream it pull-rebases all local branches, taking care of automatic stashing if necessary - it only stops for merge conflicts. Just double-click it and everything is as fresh as they are on their official repository.
  17. I can’t see past // must call all functions, defeat short circuit evaluation aVal := A(); bVal := B(); cVal := C(); Result := aVal or bVal or cVal; I don’t care for temporarily disabling short circuit evaluation. I’d rather have the predictability of one rule for expression evaluation. Mix and match adds an impedance to understanding for the reader.
  18. As you are always obfuscating your code with love, I can't imagine why didn't you go with Result := Ord(a) + Ord(b) + Ord(c) + Ord(Result) > 0;
×