Project

General

Profile

Feature #1457

Make SmoothFactor interruptible

Added by John Abbott almost 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Improving
Target version:
Start date:
10 May 2020
Due date:
% Done:

100%

Estimated time:
0.99 h
Spent time:

Description

The following is disappointingly slow:

N := factorial(1000000);
facs := SmoothFactor(N, 1000000);

Slow and not interruptible.

Make it interruptible!


Related issues

Related to CoCoALib - Feature #718: Insert calls to CheckForInterruptClosed2015-05-21

Related to CoCoALib - Bug #1458: Redesign interrupt mechanism?Rejected2020-05-10

History

#1 Updated by John Abbott almost 4 years ago

  • Related to Feature #718: Insert calls to CheckForInterrupt added

#2 Updated by John Abbott almost 4 years ago

  • Related to Bug #971: CheckForInterrupt does not work in the expected way added

#3 Updated by John Abbott almost 4 years ago

  • Related to Design #1086: New design for interrupt mechanism added

#4 Updated by John Abbott almost 4 years ago

  • Related to deleted (Bug #971: CheckForInterrupt does not work in the expected way)

#5 Updated by John Abbott almost 4 years ago

  • Related to deleted (Design #1086: New design for interrupt mechanism)

#6 Updated by John Abbott almost 4 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 50
  • Estimated time set to 0.50 h

I have added the obvious call to CheckForInterrupt in the main loop in SmoothFactor (just for BigInt).

Testing led to a surprise -- see related issue.

#7 Updated by John Abbott almost 4 years ago

  • Related to Bug #1458: Redesign interrupt mechanism? added

#8 Updated by John Abbott almost 4 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 80

The problem is that SmoothFactor has two (nested) loops either of which can be slow; but I had inserted a call to CheckForInterrupt only in the outer loop.

Now it seems to work fine.

#9 Updated by John Abbott almost 4 years ago

  • Status changed from Resolved to Feedback
  • % Done changed from 80 to 90
  • Estimated time changed from 0.50 h to 0.99 h

Speed test was OK. Also improved impl of SmoothFactor, but see #1463.

Checked in.

#10 Updated by John Abbott over 3 years ago

  • Status changed from Feedback to Closed
  • % Done changed from 90 to 100

Also available in: Atom PDF