Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-16715

Poor code for count(x) > n

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.4.0
    • Component/s: Code Generator
    • Labels:

      Description

      Spotted in example addressclean1b.

      I'm not sure what the underlying ECL is, but activity 392 contains the following code at the end of the onStart():

      		byte * rowJ39;
      		rowJ39 = (byte *)vQ19.getbytes();
      		byte * endK39;
      		endK39 = rowJ39+vR19;
      		for (;rowJ39 < endK39;) {
      			crN19.createRow();
      			rtlWriteInt3(crN19.rowBuilder().row() + 0U,*((int *)(rowJ39 + 0U)));
      			crN19.finalizeRow(3U);
      			rowJ39 += 4U;
      		}
      		byte * rowL39;
      		byte * * curM39 = crN19.queryrows();
      		unsigned vN39 = crN19.getcount();
      		for (;vN39--;) {
      			rowL39 = *curM39++;
      			vM19++;
      			if (vM19 > 251LL) {
      				break;
      			}
      			vL19++;
      		}
      

      Why wasn't that optimized to remove the project(), and why wasn't the count executed inside the previous loop?

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                ghalliday Gavin Halliday
                Reporter:
                ghalliday Gavin Halliday
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: