>
> You are right, inheriting from PrimitiveArray isn't very useful.
>
> > Concerning map/map!: if we care about speed of them then we
> > need specialized version. But I am not sure if we care.
>
> Why not care about its performance?
With current Spad compiler explicit loop will be as fast and
usually significantly faster than map/map!. So map/map!
will be used only in noncritical cases.
> map! in IndexedAggregate uses indices(), which returns a
> List, costs much more memory.
>
> This makes me doubt the usefulness of PrimitiveArray:
> Its feature is 0-based, elt has no bound checking (same as qelt).
>
> The original purpose of PrimitiveArray is performance? To utilize
> its no bound checking elt? But almost other functions on PrimitiveArray
> is unoptimized compared with ARRAY1 or IARRAY1(S, 0).
PrimitiveArray is used in several performance critical parts.
Its fast accessors are important. Other functions apparently
have very little impact on performance.
In other post I wrote about my approach to performance. To
make it clearer, there are a lot of places in FriCAS that
can be made faster. The question is were to allocate effort,
current and future. I mention future effort because optimizations
have some cost to maintain. In particular we want to choose
optimizations that give maximal effect with small effort.
Also, optimizing one place can make other slower simply
because optimized code is larger (or we have several
versions of code) and make caches less efficient.
Also, it importat to optimize for actual use case: gcc
folks observed that in normal use compiler speed was
related to memory usage. They obtained speed up by
using smaller data structures. Now, on microbenchmarks
such changes look like pessimizations because smaller
data structures meant more code to pack and unpack
data. But in actual use it was a win (presumably
smaller data was more cache friendly).
Now, faster 'map/map!' in PrimitiveArray is probably
worthwile the effort. But it is not so clear as
you think.
--
Waldek Hebisch
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/fricas-devel.
For more options, visit https://groups.google.com/d/optout.