-
Content Count
2084 -
Joined
-
Last visited
-
Days Won
29
Everything posted by Attila Kovacs
-
@Mahdi Safsafi No, this was my question 🙂 "As a general rule, most if not all Intel CPUs assume forward branches are not taken the first time they see them. See Godbolt’s work." After reading the articles again, I would say, "forward branches are not taken the first time" means, no conditional forward jumps are taken by the predictor for the first time. Am I right?
-
@Mahdi Safsafi I see thx. Which one is the forward branch again? The if or the else section? I'm not sure here anymore.
-
@Mahdi Safsafi Thx for your explanation through the example with source code, really nice. I was curious how the prediction works and found that "As a general rule, most if not all Intel CPUs assume forward branches are not taken the first time they see them. See Godbolt’s work." and "Forward branches dominate backward branches by about 4 to 1 (whether conditional or not). About 60% of the forward conditional branches are taken, while approximately 85% of the backward conditional branches are taken (because of the prevalence of program loops). Just knowing this data about average code behavior, we could optimize our architecture for the common cases. A "Static Predictor" can just look at the offset (distance forward or backward from current PC) for conditional branches as soon as the instruction is decoded. Backward branches will be predicted to be taken, since that is the most common case. The accuracy of the static predictor will depend on the type of code being executed, as well as the coding style used by the programmer. These statistics were derived from the SPEC suite of benchmarks, and many PC software workloads will favor slightly different static behavior." However I did not found anything about "first time they see them", in what inertia system are they considered as "first seen". This means, we can tell that at the first "if" in the example above, the prediction is "not to take the else case". Not sure what happens on the next call to the method though,
-
@Kas Ob. Ah, I see, what you were referring to. But this was/should be the case even without knowing any implementation detail of the CPU. At least for me. Yes, considering this, an early exit could screw the cpu's o-of-order algo. Interesting.
-
@Kas Ob. Nice, this quote about Intel and their work. Now, how does an early exit vs. an "if then begin end;" differ, as the Delphi compiler, as far I have seen until now, does not multiply the return code but results in jumps to the end. Only the condition changes, true/false.
-
And how do you measure the out-of-order-execution's algorithm's power consumption? Isn't it possible that for saving some cycles in the code, this algo in the cpu has to consume a bit more energy?
-
if (FPosition >= 0) and (Count >= 0) then also translates to if not ((FPosition >= 0) and (Count >= 0)) then goto @exitpoint; so I can't see any performance hit on Exit(). Also, I can't see any sense for any optimization in this method. Do you really need to save 1-2 CPU cycles in a stream operation? Strange.
-
Disadvantage of using defined type of TArray?
Attila Kovacs replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
While refactoring is still not perfect and does not work every time, I could improve it with turning off "View references before refactoring". -
Disadvantage of using defined type of TArray?
Attila Kovacs replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
I can remember the post on G+ by Stefan about the bloated .dcu's and the affected linking time, but this is the first time I see a "workaround". -
Disadvantage of using defined type of TArray?
Attila Kovacs replied to Mike Torrettinni's topic in Algorithms, Data Structures and Class Design
TArray<TItem> is TArray<T>, TArray is a class. -
http://docwiki.embarcadero.com/RADStudio/Rio/en/Managing_Transactions_(FireDAC) btw, what is the connection's transactioncount in the original "defect" code right before the update?
-
you have to end the transaction either with commit or with rollback, so rollback comes into the except block
-
ParnassusCoreEditor.dll AccessViolation
Attila Kovacs replied to bazzer747's topic in Delphi Third-Party
-
ParnassusCoreEditor.dll AccessViolation
Attila Kovacs replied to bazzer747's topic in Delphi Third-Party
There was a thread about it here how to rename the dlls, AFAIR @Uwe Raabe knows best. -
I'd be surprised if there was more changes than the compiler directives in the .inc file.
-
Converting project from Delphi 2006 to Delphi 10.2
Attila Kovacs replied to RTollison's topic in General Help
it also copies all the 64 chars so the truncate trick is still needed SetString(PaperName, p, 64); PaperName := PChar(PaperName); -
Converting project from Delphi 2006 to Delphi 10.2
Attila Kovacs replied to RTollison's topic in General Help
@Anders Melander Wouldn't be a SetString() nicer? -
Converting project from Delphi 2006 to Delphi 10.2
Attila Kovacs replied to RTollison's topic in General Help
use DeviceCapabilities() instead of DeviceCapabilitiesA(), then you will also find examples -
How can I convert multiple fields to properties? It always converts the only one from the current line, where the cursor is positioned.
-
@Uwe Raabe I see, I don't have this panel on the left, I'll just roll my own to work with selection. Thx anyway.
-
@Lars Fosdal I mean MMX Code Explorer. MMX->Conversion-> Convert to property In the dialog title is "Field(s)" but I can't get it to work with multiple fields.
-
Is that anywhere documented that RTTI is screwd up/missing on types declared in a console app's dpr? Maybe every kind of dpr. brr
-
RTTI in dpr / console app dpr
Attila Kovacs replied to Attila Kovacs's topic in RTL and Delphi Object Pascal
http://docwiki.embarcadero.com/Libraries/Rio/en/System.Rtti.TRttiType.QualifiedName "QualifiedName is only available for public types declared in the interface section of a unit." FQN makes only sense for public declarations = interface section, so no FQN for dpr members, and no lookup-table entry for those non-public types. TRealPackage.MakeTypeLookupTable makes it clear as it starts with "units := GetUnits;". At the end, we are still discussing the same what was said to me 3 days ago. -
RTTI in dpr / console app dpr
Attila Kovacs replied to Attila Kovacs's topic in RTL and Delphi Object Pascal
found by accident -
RTTI in dpr / console app dpr
Attila Kovacs replied to Attila Kovacs's topic in RTL and Delphi Object Pascal
Ignoring Mahdis corrected answer (which was actually the answer, he nailed it, even though my question was very lazy and broad) and acting like a spring, chanting the same in reply to his first comment is nothing else just trolling and does not help here.