[Not an issue] PasMP just helped FPC get the top Binary Trees score on BenchmarkGames! #11
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
BeRo1985/pasmp#11
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Just thought I'd link you to this.
Hm,
with TData(Data^)[FromIndex] do beginshould befor Index := FromIndex To ToIndex do with TData(Data^)[Index] do begin:-)That was one thing that has confused me actually... when I've used
WriteLnto examine the values ofFromIndexandToIndexbefore, it seems like they are always the exact same number, meaning the for loop would not do anything.How does that work, exactly?
ParallelFor spilts the whole range in multiple FromIndex..ToIndex sub-ranges parallel-recursively, so you must do
for CurrentWorkIndex:=FromIndex to ToIndex do begin ... end;in any case, even when FromIndex is (most) always the same value like ToIndex on your own system, but it can different on other systems (for example for higher CPU core counts) or even on different system loads on your current system. Otherwise the benchmark implementation is not valid.Would this be the correct way to write it, then:
Rather
where all
FromIndexare replaced withIndex, and not just the first appearance ofFromIndex.and play with the
Granularityparameter ofParallelFor, this is the smallest minimum value, how small a subdivided subrange can be as a minimum size.Ok, I'll try a version with that. The benchmark did seem to give inconsistent results, so maybe that's why.
One other question: do you think it would be faster to do:
than it is to create the global instance?
Just use TPasMP.GetGlobalInstance in the most normal cases. Individal TPasMP instances are only for special cases necessary, for example when the root thread of a TPasMP instance is/should not the main thread of the whole process instance, and so on.
And please notify me, when it is also updated on
https://benchmarksgame-team.pages.debian.net/benchmarksgame/performance/binarytrees.htmlIt just went back up to the top again (both of the existing "incorrect" versions I've submitted so far.)
I will let you know when the new "correct" version has gone up though, certainly. Thanks again for the great library!