Opened 3 years ago

Last modified 3 years ago

#24992 needs_work enhancement

Fix usage of symbolic comparison in several places

Reported by: rws Owned by:
Priority: major Milestone: sage-8.2
Component: performance Keywords:
Cc: cheuberg, dkrenn Merged in:
Authors: Ralf Stephan Reviewers:
Report Upstream: N/A Work issues:
Branch: u/rws/fix_usage_of_symbolic_comparison_in_several_places (Commits, GitHub, GitLab) Commit: d08957e7e6f1ae52b473cdda0a24eb4ddd5366f8
Dependencies: Stopgaps:

Status badges

Description (last modified by rws)

Symbolic comparison is wrongly used in several places throughout Sage (overview https://trac.sagemath.org/wiki/symbolics/nonzero). The ticket replaces code involuntarily calling __nonzero__ with a call of the is_zero or is_equal member functions to clarify if simplification is needed or not. The code positions calling __nonzero__ were obtained by raising an exception in __nonzero__ and analyzing the resulting doctest fails. Of course not every simplification is unwanted so every case must be considered and tested.

Change History (8)

comment:1 Changed 3 years ago by rws

  • Description modified (diff)

comment:2 Changed 3 years ago by rws

  • Description modified (diff)

comment:3 Changed 3 years ago by rws

  • Branch set to u/rws/fix_usage_of_symbolic_comparison_in_several_places

comment:4 Changed 3 years ago by git

  • Commit set to e1942d058adf7de66fdac1ac005953cd32d872b3

Branch pushed to git repo; I updated commit sha1. New commits:

e1942d024992: fixes

comment:5 Changed 3 years ago by rws

  • Cc cheuberg dkrenn added

I get a 10-15% decrease of CPU time with this branch when doing sage -tp src/sage/rings/asymptotic/ (from 31.5s to 26.5-28.5s).

It's not finished, there are more instances in Sage where the changes can be applied.

comment:6 Changed 3 years ago by git

  • Commit changed from e1942d058adf7de66fdac1ac005953cd32d872b3 to d08957e7e6f1ae52b473cdda0a24eb4ddd5366f8

Branch pushed to git repo; I updated commit sha1. New commits:

d08957e24992: more optimizations

comment:7 Changed 3 years ago by rws

  • Authors set to Ralf Stephan
  • Status changed from new to needs_review

comment:8 Changed 3 years ago by rws

  • Status changed from needs_review to needs_work
Note: See TracTickets for help on using tickets.