#208 Optimizing [if {[string compare]} ...]


This patch converts [string compare] so that it
generates INST_STR_EQ;INST_LNOT instead of INST_STR_CMP
when the comparison is going to be used as a boolean
test in the [if], [for] and [while] commands. This
should be faster, particularly on longer strings,
because we don't need to know how the strings differ.
Part of the patch could be construed to form the basis
for a more general optimization framework, but that
probably needs more work to realize...


  • miguel sofer

    miguel sofer - 2002-05-30

    Logged In: YES

    Updated patch (after HEAD modifs due to [Bug 562383].

  • Jeffrey Hobbs

    Jeffrey Hobbs - 2002-08-08

    Logged In: YES

    While this looks good in general, I'd prefer focusing on a post-
    pass optimizer that can look at the whole tree and streamline
    such cases globally. Thus we could also get rid of the
    INST_TRY_CVT_NUMERIC in many cases, along with finding
    INST_STR_CMP == 0 static, which is INST_STR_EQ, etc.

  • miguel sofer

    miguel sofer - 2006-09-30
    • status: open --> pending
  • miguel sofer

    miguel sofer - 2006-09-30

    Logged In: YES

    After so many years ... we'll eventually have the

  • SourceForge Robot

    • status: pending --> closed
  • SourceForge Robot

    Logged In: YES

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).

  • Donal K. Fellows

    Logged In: YES

    Assigned to me so I remember to revisit this once we've
    solved the general optimization stuff.

  • Donal K. Fellows

    • priority: 5 --> 1
    • assigned_to: msofer --> dkf
    • status: closed --> open-later
  • Donal K. Fellows

    • priority: 1 --> 2

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks