Hi Jimmy,
I made a couple more changes:
- I added
SequenceableCollection>>#sum
| sum |
sum := 0.
1 to: self size do: [ :each |
sum := sum + (self at: each) ].
^ sum
as an extension method. It is not 100% semantically the same as the original,
b
Can you come up with a simple "base case" so we can find the bottleneck/problem?
I'm not sure about what you're trying to do.
What do you get if you try this in a workspace (adjust the value of n to what
you want, I tested it with 10 million items).
Let's get this one step at a time!
| floatArr
> On 7 Jan 2022, at 16:05, Jimmie Houchin wrote:
>
> Hello Sven,
>
> I went and removed the Stdouts that you mention and other timing code from
> the loops.
>
> I am running the test now, to see if that makes much difference. I do not
> think it will.
>
> The reason I put that in there is
Hello Sven,
I went and removed the Stdouts that you mention and other timing code
from the loops.
I am running the test now, to see if that makes much difference. I do
not think it will.
The reason I put that in there is because it take so long to run. It can
be frustrating to wait and wai
Hi Jimmie,
I loaded your code in Pharo 9 on my MacBook Pro (Intel i5) macOS 12.1
I commented out the Stdio logging from the 2 inner loops (#loop1, #loop2) (not
done in Python either) as well as the MessageTally spyOn: from #run (slows
things down).
Then I ran your code with:
[ (LanguageTest n
As I stated this is a micro benchmark and very much not anything
resembling a real app, Your comments are true if you are writing your
app. But if you want to stress the language you are going to do things
which are seemingly non-sense and abusive.
Also as I stated. The test has to be sufficie
After christmas holidays, work started again this week: 5 PRs merged, 8 issues
fixed:
FIXES
=
- Fixes #10263 Setting minimum size for browser window #10686
https://github.com/pharo-project/pharo/pull/10686
- 9697-FTExamplesexampleTree1-menu-item-Expand-All-freezes-image #10
Yes, I just saw also that I used an interval instead of an array… I need to
sleep more ^^
Anyways, even with a 28k large array wether they are small integers or floats,
I have "reasonable results” (where reasonable = not taking hours, nor minutes
but a couple of milliseconds :P)
randarray := A
Thanks John
This was an important remark :)
Another remark is that you can also call BLAS for heavy mathematical operations
(this is what numpy is doing just calling large fortran library and I do not
know for julia but it should be same).
And this is easy to do in Pharo.
https://thepharo.dev