Menu

#4390 Time loss in expr

obsolete: 8.5.7
closed-invalid
5
2009-07-22
2009-07-22
No

OS Platform Linux (openSuSE 11.0 and Ubuntu 8.04.2) and Windows XP (ActiveState Release 8.5.6 and 8.5.7)

Problem Behavior: expression execution time grows continuously
Expected Behavior: expression execution time approximately constant

In attached file, I leave to you the script that shows this behavior
(almost certainly due to conversion between numbers):
is this behavior 'to be considered right' ?

If you need further information I am available.

Discussion

  • Alberto Marchesini

    Test Script

     
  • Don Porter

    Don Porter - 2009-07-22
    • status: open --> closed-invalid
     
  • Don Porter

    Don Porter - 2009-07-22

    print the value of $t to see what is happening.

    Note that in Tcl 8.4 integer values had limited
    range and when that range was overflowed
    the values truncated to that range automatically.

    Scripts like yours depend on that truncation.

    In Tcl 8.5 integer range is unlimited. Without
    truncation,the integers grow bigger. It takes
    longer and longer to compute on bigger
    and bigger integers.

    The solution, as noted in the release notes
    of Tcl 8.5.0 as something to take care over
    when migrating from earlier Tcl releases,
    is to make your integer truncation needs
    explicit by putting the appropriate int(.)
    or wide(.) function calls in your expressions.