Leaderboard
Popular Content
Showing content with the highest reputation on 03/25/25 in all areas
-
Dictionaries, Hashing and Performance
Stefan Glienke replied to Clément's topic in Algorithms, Data Structures and Class Design
I just came across this thread while searching for something else, and while reading this code, I want to make a few points: I agree on the essential point: when you know how many items you will add to a collection, it is always beneficial to set the capacity upfront. Now, even though this is some naive benchmark code, it shows a few things: - Calling ContainsKey before the attempt to call Add means performing the lookup twice, which has not been necessary at all since Delphi 10.3 because of the new method TryAdd. On my machine, the tests go down from 51ms and 31ms to 44ms and 26ms. - The hash function is one of the key parts that makes or breaks a dictionary performance-wise. The numbers I posted are from 12.3, which already uses a better hash algo (FNV1a) than it did years ago (BobJenkins) but is still far away from ideal. Especially for Integer keys, if the hashtable is designed in a robust way of dealing with hash collisions and clustering, you can get away with not hashing anything but using the value itself. Unfortunately, the RTL one is not built in that way, but for this benchmark, it is fine to replace the eq compare it uses with the one from Spring4d, which does what I mentioned before. This brings down the numbers to 36ms and 22ms. That is another 15% improvement. Now Spring4d would not be Spring4d if it did not have another trick up its sleeve: when it uses the default eq compare, the hashtable does not need to call GetHashCode and Equals for some intrinsic types such as Integer because the value itself is used as hashcode and for checking Integer equality it does not need to call some method. That leads to the above test with initial capacity taking 14ms.- 59 replies
-
- tdictionary
- tstringlist
-
(and 2 more)
Tagged with:
-
Tried to create a SIMD (AVX2 based) Quicksort: https://github.com/mikerabat/SimdQSort For anyone who is interested... It supports Int32, Int64, Single and Double Array sorting - no custom struct size nor user defined compare procs. Speedup for large random arrays is up to 3.5 🙂
-
Who told you such nonsense? The variable will just be overwritten!
-
xaml island Ask if Embarcadero will integrate UWP & WinUI in comming Version of Radstudio
Brandon Staggs replied to bravesofts's topic in Windows API
Oh come off it. Nobody cares if you use it or not. Your posts are so overly verbose and grandiose that even if there is merit in what you are asking for, nobody can find it. In fact, you seem like you are trolling us with AI generated gibberish that almost but not quite seems to be making a point. And I would prefer not to feed trolls. -
xaml island Ask if Embarcadero will integrate UWP & WinUI in comming Version of Radstudio
Frickler replied to bravesofts's topic in Windows API
Joel Spolsky has written about this some 23 years ago in his famous "Fire and Motion" article. In short, Microsoft "invents" new technology, and while devs try to adapt to that, Microsoft just drops that for a "newer, better" technology. And so on, and so on. -
xaml island Ask if Embarcadero will integrate UWP & WinUI in comming Version of Radstudio
eivindbakkestuen replied to bravesofts's topic in Windows API
The above posts make a perfect case for why Ctrl+B should be used sparingly. -
I'm sure he'll get here at some point, but I've been chatting with him about this.... So yeah, his development stands on a threadpool. There's a lot of really interesting aspects to it too. Looking forward to the Amsterdam Delphi event where he can say more.
-
Thread safety has nothing to to with speed. Strings are reference-counted and string assignment is not atomic operation. Assigning string variable from multiple threads can mess up the reference count and cause memory leaks and crashes. Yes. Access to the string needs to be protected (that includes other code that accesses that string even if it is just being read from). But, if the leaks are still there, then there are most likely some problems in other code you haven't posted. Which Delphi version are you using?
-
xaml island Ask if Embarcadero will integrate UWP & WinUI in comming Version of Radstudio
Dalija Prasnikar replied to bravesofts's topic in Windows API
Thank you! I would never do that. Disagreement does not imply lack of respect. It was not meant to bother you. This is why I also put a smiley at the end of my sentence. The point was to bring attention to your posts which are hard to read because of your AI usage. AI can be helpful, especially for communication and I know people who are able to communicate their thoughts better with the help of AI. However, that involves using AI very lightly and mostly for translating and fixing text they actually wrote. When you give AI more freedom to write things for you, the effects will commonly be the opposite. I am finding your posts where you used AI extremely hard to read. They are long and unnecessarily wordy. Another problem (not that relevant here and now) is that when one can clearly recognize something being AI generated more than having some light AI touches, one cannot be sure whether you are actually discussing something with a person or merely an AI. Are the points and arguments used really the ones that the person has tried to make or it is just something AI put there? It is hard to have a conversation in such situations. Nobody is trying to prevent anyone from using AI. You are free to use it all you like. I am not sure what you mean by spying or using third party tools. I am neither spying on you, nor I am using any tools for AI detection. As a Stack Overflow moderator, I have seen first hand the huge amount of damage AI can cause. The amount of posted AI answers there (where vast majority of them are completely incorrect AI slop) is not measured in thousands. It is measured in tens and hundreds of thousands. There are users who posted hundreds and even thousands AI answers. Imagine how much more of such posts would be there if AI would be allowed there. The site would be overflowed with AI. The only reason why AI is forbidden there is to preserve the site as repository of knowledge and a place where you can go and get help from actual experts in their field. Unfortunately, the only means moderators have to fight such influx of AI answers is to remove all and every one where some AI usage is detected (even when it is used merely for translating). We cannot easily distinguish between post which were fully AI generated and ones that were merely improved by AI. On the scale of Stack Overflow, with only handful of moderators removing AI, we cannot judge the correctness of each and every answer. Unfortunately, it would. You cannot add feature without removing the time needed to do implement said feature, from something else. That means less improvements in already used frameworks (VCL and FMX), less bug fixes, less IDE improvements. Embarcadero is not Microsoft, nor Apple, nor Google. They need to pick what they will do carefully to maximize benefits to all customers, which means focusing on the things that cannot be easily provided by 3rd party. -
Actually it is not nonsense at all. This is the source of your memory leaks. String assignments are not thread-safe.
-
Thank you very much, Mark! This is the starting/reference point I needed. It seems I started with wrong DriverID, and thus no chance to make it.
-
xaml island Ask if Embarcadero will integrate UWP & WinUI in comming Version of Radstudio
HemulGM replied to bravesofts's topic in Windows API
Use it 😃 for FMX https://github.com/HemulGM/DelphiWinUI3 -
No, you can start the implementation.
-
xaml island Ask if Embarcadero will integrate UWP & WinUI in comming Version of Radstudio
Lars Fosdal replied to bravesofts's topic in Windows API
@bravesofts Place a feature request at EMBT's JIRA. Nothing is decided on this board. -
Yes it is possible, we and some of our customers connect to MS Access. Not the most used database, but used. From our user manual: Direct connect to the data base At least these three parameters must be present for direct connection to a database via ODBC. DriverID ODBCDriver Database A DSN can be used and then just a DataSource parameter is needed. I know it worked when I tested it but, I have never seen a user apply it. All I have seen is the first example and it is what I use. Mark
-
[dcc32 Error] Type parameter 'T' must be a non-nullable value type
Remy Lebeau replied to EugeneK's topic in RTL and Delphi Object Pascal
That StackOverflow post is about the error on a Custom Managed Record, but the code shown above is not using a CMR. It is just a regular Managed Record due to the string field (has nothing to do with the custom Attribute). And according to RSS-3043 (which has been closed last week as "As Designed"): -
xaml island Ask if Embarcadero will integrate UWP & WinUI in comming Version of Radstudio
Dalija Prasnikar replied to bravesofts's topic in Windows API
@bravesofts Maybe you would have better chances of convincing people if you would write your own thoughts instead of letting AI write them for you Delphi already has VCL and FMX frameworks. Feature wise it makes very little sense for Embarcadero to introduce yet another visual framework. Wrapping WinUI can be done through 3rd party, it doesn't have to be supported by Embarcadero. I would prefer that they focus on things that cannot be provided by 3rd party, like: compiler, debugger, language features, IDE functionality.... -
Connecting to MS Access (.accdb) in Delphi 12
Anders Melander replied to Squall_FF8's topic in Databases
That's why they pay us the big bucks 🙂 Here's some links that might be relevant: https://learn.microsoft.com/en-us/office/troubleshoot/access/cannot-use-odbc-or-oledb https://how-to.aimms.com/Articles/129/129-MSACCESS-32bit-64bit.html -
xaml island Ask if Embarcadero will integrate UWP & WinUI in comming Version of Radstudio
Der schöne Günther replied to bravesofts's topic in Windows API
Embarcadero has been having too many coals in the fire for years now. Instead of opening the next can of worms, they should be fixing basics like code completion. I remember being in the Microsoft Technology Adoption Program where you got Teams meetings with the developers behind WinUI and other Windows components, got shown not yet released roadmaps and got to ask questions. Back then, it was basically impossible to properly use WinUI outside of Microsoft's Visual Studio (not sure if it was WinUI2 or 3). At that time, they openly replied to me that they had no plans to change that. Except WebView2 has been usable for basically everybody from everywhere, and it's actually good. You can see it being used in a lot of software, not just Microsoft's own products. Just look at how much stuff Microsoft has abandoned in the last couple of years, how much of the "Universal Windows" approach has been dialled down or completely removed already. Not to mention that new GUI stuff has been highly dependant on the most current Windows version. WebView2 even works in Windows 7. I honestly was interested in WinUI around 2018 to 2020 or so, but it certainly never took off. I firmly believe it is not relevant anymore. -
FYI Signotaur can sign MSIX files - https://www.finalbuilder.com/signotaur And it works with Certum tokens and works around the password prompts.
-
RAD Programmer Coding Challenge #1 - build a MineSweeper game in RAD Studio with a chance to with $500
vhanla replied to Darian Miller's topic in Tips / Blogs / Tutorials / Videos
Mine https://github.com/vhanla/MineSweeper it is so basic 🙈 -
Firebird handles high loads efficiently. Our database processes 25 million daily writes with real-time billing (stored procedures), and queries on 100,000 records return results in under a second. Works on mobile too!
-
When it comes to simplity and small footprint, Interbase and Firebird will be a good alternative.
-
SQL Server Express is ano brainer, even InnoSetup can handle its installation automatically without user interaction. When you outgrow SQL Server Express, you can upgrade to a more powerful SQL Server edition such as Standard or Enterprise, or migrate your data to a scalable cloud-based database solution like Azure SQL Database. Avoid exotic DBMSs that introduce you to a labyrinth of their own dialects, from which there is no turning back.
-
GExperts now fixes yet another annoyance in the Delphi IDE: Desktops
dummzeuch replied to dummzeuch's topic in GExperts
Edit: Fixed the problem with the full screen window in revision #4468.