Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: dd7ba185e873fe721a290e8dd9feea50c62934390cda42bb173fe0184b255bb1
Ticket: 8dd2807066d7cc4d8604164f39b7f0d65c0dc321
bug in single-argument 'max' with bignums
User & Date: sebres on 2025-11-12 22:08:55
Changes

  1. closedate changed to: "2460992.42286065"
  2. closer changed to: "sebres"
  3. icomment:
    [780d2f3375e35f2c] illustrates what I meant with unneeded CoR (copy on read)...
    This improves <code>TclCompareTwoNumbers</code> by usage of internal representation of bignum representations of objects during copmpare process without to copy/free them.
    
    Additionally it is also 4x faster than with a copy:
    <code><pre>
      % apply {{} { set x [expr 2**64]; set y [expr 2**65]; timerate { expr {$x < $y} } }}
    <b style="color:red">- 0.235482 µs/# 3729340 # 4246611 #/sec 878.192 net-ms</b>
    <b style="color:green">+ 0.061164 µs/# 10849804 # 16349472 #/sec 663.618 net-ms</b>
      % apply {{} { set x [expr 2**64]; set y [expr 2**65]; timerate { expr {max($x,$y,$x,$y)} } }}
    <b style="color:red">- 0.970795 µs/# 996554 # 1030083 #/sec 967.450 net-ms</b>
    <b style="color:green">+ 0.216824 µs/# 4035058 # 4612032 #/sec 874.898 net-ms</b>
    </pre></code>
    
    I'd like to merge it later if no objections follow.
    
  4. login: "sebres"
  5. mimetype: "text/x-fossil-wiki"