Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 66444387dea0e9fd03497527e65be571224ddab8
Ticket: 2800722fffffffffffffffffffffffffffffffff
big integer parsing is O(N^2)
User & Date: dgp on 2009-06-03 21:07:21
Changes

  1. assignee changed to: "dgp"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    
    Integer values  up to 917476 bits (see TIP 237)
    get stored in a special packed Tcl_Obj intrep for
    mp_ints .  To parse a string rep of an integer of 
    that size requires about 30 seconds, and the
    string rep getting parsed is roughly 200000 
    digits/characters/bytes long.
    
    Larger integer values are permitted using an
    unpacked intrep representation.  However,
    imagining string reps growing up to Tcl's
    limits of roughly 2000000000 digits/chars/bytes,
    the N^2 algorithm(s) used to parse bite hard,
    and a reasonable guess is about 40 years
    to parse such a string into its mp_int
    equivalent.
    
    An alternative with smaller complexity for switching over to at
    some point is needed if operations on these
    values are ever to be of any actual use.
    
    The same problem in reverse arises when
    producing the string rep of a large mp_int
    value.
    
  4. foundin changed to: "None"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "dgp"
  10. subsystem changed to: "48. Number Handling"
  11. title changed to: "big integer parsing is O(N^2)"
  12. type changed to: "RFE"