On 2017-09-16, Simon King <simon.k...@uni-jena.de> wrote:
> I thought I was told about faster matrices by my former boss, David
> Green, but by searching my mails I found that I was pointed to
> ImmutableMatrix by Dima Pasechnik.
>
> Let's see if that's fast enough...

It is an improvement, but not good enough:

sage: %time libgap.Read("path/to/my/modified_data.gap")
CPU times: user 30 s, sys: 224 ms, total: 30.3 s
Wall time: 32.6 s
sage: G = libgap.eval('basicalg')
sage: M1 = G['1a4a1']['mat']
sage: M2 = G['4a1a1']['mat']
sage: M1
< immutable compressed matrix 896x1984 over GF(8) >
sage: %time M = M1*M2
CPU times: user 2.48 s, sys: 0 ns, total: 2.48 s
Wall time: 2.48 s

So, time for reading into gap was almost doubled, and the time
for multiplication, though clearly faster than the original
version, still is much more than the few milliseconds that
Sage needs for multiplying those matrices. Moreover, the conversion
of ImmutableMatrix from libgap to Sage takes ages and doesn't give
the correct result:
sage: %time MS1 = M1.sage()
CPU times: user 8min 24s, sys: 88 ms, total: 8min 24s
Wall time: 8min 25s
sage: type(MS1)
<type 'list'>

What to do? As sage_eval sucks, I should probably just try to
write the code into a (python) file and use sage.repl.load.load.
Provided that sage.repl.load.load is faster: Should perhaps
sage_eval by default write the to-be-evaluated code (if it exceeds
a certain length) into a temporary file and sage.repl.load.load it?
If "yes", then I will open a ticket for it.

Best regards,
Simon

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-support+unsubscr...@googlegroups.com.
To post to this group, send email to sage-support@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.

Reply via email to