Opened 7 years ago

Last modified 6 years ago

#14652 needs_work defect

Lazy imports for WeylGroup and other MatrixGroups

Reported by: vbraun Owned by: joyner
Priority: major Milestone: sage-6.4
Component: group theory Keywords:
Cc: Merged in:
Authors: Volker Braun Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #14014 Stopgaps:

Description

This patch makes various imports lazy so that less modules are dragged in on startup.

Attachments (1)

trac_14652_lazify_imports.patch (16.3 KB) - added by vbraun 7 years ago.
Updated patch

Download all attachments as: .zip

Change History (10)

comment:1 Changed 7 years ago by vbraun

  • Summary changed from Laziy imports for WeylGroup and other MatrixGroups to Lazy imports for WeylGroup and other MatrixGroups

Changed 7 years ago by vbraun

Updated patch

comment:2 Changed 7 years ago by vbraun

  • Dependencies set to #14014
  • Status changed from new to needs_review

comment:3 Changed 7 years ago by vbraun

  • Status changed from needs_review to needs_work

comment:4 Changed 7 years ago by nthiery

I am not sure I should post this here or on #14014 but ...

With #14014 it now takes a long time the first time one creates a matrix group:

sage: %time WeylGroup(["A",3]) 
CPU times: user 10.10 s, sys: 0.11 s, total: 10.21 s
Wall time: 10.23 s

I guess that's the time needed to start gap. This feels like a lot though, and is quite annoying.

Note that just starting gap takes roughly half of that time::

mistral-~s/sage/algebras>time (echo "quit;" | sage -gap)
gap: halving pool size.
 ┌───────┐   GAP, Version 4.5.7 of 14-Dec-2012 (free software, GPL)
 │  GAP  │   http://www.gap-system.org
 └───────┘   Architecture: x86_64-unknown-linux-gnu-gcc-default64
 Libs used:  gmp, readline
 Loading the library and packages ...
 ...
5,44s user 0,16s system 98% cpu 5,661 total

And before #10414, starting Sage *and* creating a Weyl group took far less time:

time (echo "WeylGroup(['A',3])" | ../../sage)
...
sage: WeylGroup(['A',3])
Weyl Group of type ['A', 3] (as a matrix group acting on the ambient space)
Exiting Sage (CPU time 0m0.30s, Wall time 0m0.29s).
( echo "WeylGroup(['A',3])" | ../../sage; )  3,04s user 0,54s system 89% cpu 3,998 total

Well, the above measurement are probably very rough, but this still seems to be saying that there would be room for improvement. Does libgap load by default more libraries and packages than the usual gap loaded in Sage?

Cheers,

Nicolas

comment:5 Changed 7 years ago by vbraun

LibGAP doesn't use the GAP saved workspace mechanism yet. Saving workspaces has a bug that occasionally corrupts the workspace http://tracker.gap-system.org/issues/224

comment:6 Changed 7 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:7 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:8 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:9 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4
Note: See TracTickets for help on using tickets.