Uploaded image for project: 'ClojureScript'
  1. CLJS-2314

Eliminate str call on literal strings in str macro

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Completed
    • Affects versions: 1.9.854
    • Fix versions: None
    • Labels:
    • Approval:
      Accepted
    • Patch:
      Code

      Description

      The str macro unconditionally calls str on each of its arguments. This can be skipped for literal strings, saving on the unnecessary extra runtime call.

      For example: (str "x" x "y") would be compiled down to JavaScript with fewer calls ["x",u.c(a),"y"].join("")
      and silly things like (str "a" "b") compile all the way down to "ab".

        Attachments

          Activity

            People

            • Assignee:
              dnolen David Nolen
              Reporter:
              mfikes Mike Fikes
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: