FredS
Members-
Content Count
418 -
Joined
-
Last visited
-
Days Won
4
Everything posted by FredS
-
Dictionaries, Hashing and Performance
FredS replied to Clément's topic in Algorithms, Data Structures and Class Design
How come I always get homework when I come here 🙂 The code used was originally done to test a home rolled implementation of 'AddIfNotExists' in Berlin. In short that particular test won't do you any good. But here are the steps used: Turned OFF Overflow and Range checking in xxHash32 Changed the test from using the default Jenkins hash to use (that) xxHash32. This was done by copying the TDelegatedEqualityComparer used with Murmor3 and changing a single line: Result := Integer(TxxHash32.CalculateHash32(PChar(Value)^, Length(Value) * CharSize)); // Result := Murmor3(PChar(Value)^, Length(Value) * CharSize, 0); The test itself is based on a TDictionary<string,integer> where the string is a GUID appended with the for loop value. This was originally done since one version of Murmor had issues with collisions when the first part of the string was identical. That's it, as before: your mileage may vary..- 53 replies
-
- tdictionary
- tstringlist
-
(and 2 more)
Tagged with:
-
Dictionaries, Hashing and Performance
FredS replied to Clément's topic in Algorithms, Data Structures and Class Design
Four Million (Murmor3,PreAlloc): 03.021-4807 Four Million (xxHash,PreAlloc): 12.250-4320 Enough play time, if you can get xxHash32 to beat Murmor3 let me know 🙂- 53 replies
-
- tdictionary
- tstringlist
-
(and 2 more)
Tagged with:
-
Dictionaries, Hashing and Performance
FredS replied to Clément's topic in Algorithms, Data Structures and Class Design
Not installed. There is mention that xxHash32 is slower on x64, which is most likely the reason.. Equality Comparer in System.Generics.Defaults is limited to a 32bit hash..- 53 replies
-
- tdictionary
- tstringlist
-
(and 2 more)
Tagged with:
-
Dictionaries, Hashing and Performance
FredS replied to Clément's topic in Algorithms, Data Structures and Class Design
Just ran a TDictionary comparison using Murmor3 v TxxHash32.CalculateHash32: One Million (xxHash,PreAlloc): 01.446-8681 One Million (Murmor3,PreAlloc): 00.743-3334 Four Million (Murmor3): 04.895-7561 Four Million (Murmor3,PreAlloc): 03.130-7519 Four Million (xxHash,PreAlloc) : 04.491-7058 Your mileage may vary..- 53 replies
-
- tdictionary
- tstringlist
-
(and 2 more)
Tagged with:
-
Calculating accurate 'Now' or maybe System.Diagnostics.TStopWatch
-
There is DnsModifyRecordsInSet in Domain Name System (DNS) windns.h contains the following programming interfaces:
-
class designation question
FredS replied to David Schwartz's topic in Algorithms, Data Structures and Class Design
This treats TPassword like a string yet in Berlin+ you can add a unique Record Helper for TPassword. TPassword = type string; // Example of a Helper for TPassword TPasswordHelper = record helper for TPassword function CheckPwdComplexity(const MinPwdLen: Word; const Level: TPwdComplexity): boolean; function ContainsLower(const Required : Cardinal = 1): boolean; function ContainsSpecial(const Required : Cardinal = 1): boolean; function ContainsUpper(const Required : Cardinal = 1): boolean; function Secure(const ProtectWith: TSecureStringProtection = ssFast): ISecureString; function BCrypt: TBCrypt; inline; end; -
Setting 'default' will select it.
-
Stefan covered that under 'for the program itself ', don't clutter up Documents with stuff that isn't for the user's end use.. annoying 🙂
-
On Windows 10 1903.18362.476. Also your code doesn't `CoUninitialize` if IIDL is nil. ..and what does GetLastError say when you get IIDL=nil?
-
shell32 is declared in Winapi.ShlObj in the implementation section. const shell32 = 'shell32.dll'; You in Berlin or UP, or something else? You know asking Qs without supplying sufficient information simply leads to what you see here..
-
Works fine in Berlin+ Win64..
-
Defined in Winapi.ShlObj.
-
Where do I declare a function inline ?
FredS replied to dummzeuch's topic in RTL and Delphi Object Pascal
With include files one can change the inline option and skip all those IFNDEFs, tested with Berlin and up. In this case the include file includes a CustomInclude.inc, which is part of the project. This makes it simple to edit in the IDE as required. /// <remarks> /// NOTE: You can override this in CustomInclude.inc, but it requires a Build /// and won't update the Blue Dots /// </remarks> {$IFNDEF RELEASE} {-$INLINE OFF} // un-comment as needed {$ENDIF RELEASE} -
You're banking on no other form using 'TMainForm' as a class name on the system? I'd use Process Info instead, quick search gave me this: https://stackoverflow.com/questions/2616279/how-can-i-get-other-processes-information-with-delphi
-
Overload methods or use unique names?
FredS replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
Yup, or for readability (10+ years later) add it as a last parameter with a default value. -
Works here.. but that code should only run if 'IsWin8'
-
The line with 'isWin8' is required and correct and the line following with 'data[66]' should only be executed if isWin8=true.
-
Sure doesn't increases my confidence, what about False Negatives.. 🙂
-
Changed that option then used Notepad++ to generate 4 lines with LF only, pasted into 10.3.3, saved and opened the file in Notepad++, LF still terminates two of the line endings. File another bug report? 🙂
-
I read that as 'why can't Andreas fix all their bugs' 🙂
-
Or don't install EMB anything 'till your daily backup ran then recovery is a click away 🙂
-
10.3.3 breaks display when I RDP into the VM .. again (10.3.1 had this issue). So badly that its not usable without IDE Fix Pack 6.4.4.
-
Default Align setting does that already. With that default (A+) the only way to get fields that do not conform is by by packing a record.
-
@Pawel Piotrowski Yes, but you launch 20 threads. My point was about a single write single read thread. But regardless my test also fails when increased to 10 million with single steps..