foundset iterator

Hi,

foundest has a new iterator method for simply loop on record.
I create a new table with two columns,

newTable
tableId counter

and create two function

  • populateTable
  • editRecords

in populateTable i create, in a loop of 10000, the new records of table (total 30000 new records created in 1 minute and 30 seconds) .
in editRecords i try the new iterator for edit all the records in table in ~3 minutes.

On previous version i’m wait 10 minutes for the same single operation.

Good work :wink: :P

Good that it works well for you. But this feature was already available in Servoy 7.4 :-)

Wow it’s fantastic.
But when servoy 7.4 will released?

Bye Bye

poyel:
But when servoy 7.4 will released?

This should be rephrased to: when was 7.4 released ;-) (march 2014)

In the meantime 7.4.1 was released:
https://www.servoy.com/forum/viewtopic.php?f=16&t=20397

For a complete overview of releases, you can keep an eye on this part of the forum:
https://www.servoy.com/forum/viewforum.php?f=16

Oh i’m sorry :P

i’m going in confusion with all this versions :P

I’m waiting for the 7.4.2 :mrgreen:

Interesting… what’s that iterator method?

new features are not always good communicated! :cry: (also this one, was totally new for me)
I also looked into the release notes, on this forum, but I can’t find any reference to this new iterator…

I googled the Servoy Wiki and found this:

https://wiki.servoy.com/display/DOCS/Th … y+Foundset

The foundset iterator is like the iterator over the array.

You can call

foundset.loadAllRecords();
foundset.forEach(
           /**
             * @param {JSRecord} record
             * @param recordIndex
             * @param {JSFoundset} fs
             */
            function(record, recordIndex, fs) {
                application.output("record processed: " + record + ", record index: " + recordIndex);
            }
);

instedof

foundset.loadAllRecords();
for (var i = 1; i <= foundset.getSize(); i++) {
application.output("record processed: " + foundset.getRecord(i) + ", record index: " + i);
}

With this new features you are able to loop through the foundset’s record most rapidly.

I hope I was clear in explaining.

Bye Bye

Awesome! Thanks, poyel

poyel:
With this new features you are able to loop through the foundset’s record most rapidly.

I hope I was clear in explaining.

Bye Bye

the point I’m making is, that NOwhere is communicated that this features is 3 times faster. It only states that it is safer in certain circumstances.

I hadn’t heard about that feature before.
And I cannot find it in the Wiki at JSFoundSet | Docs

yup, it’s hard to find

https://wiki.servoy.com/display/DOCS/Th … y+Foundset

The iterator was not designed to be faster, just to be safer and I cannot think of why it would be faster (but good if it is for you).

In addition to the releasenotes on the forum (which is just a list of caseid’s with their topics), there was also always a “New in X.x” page posted in the wiki documentation for the specific version, which gave a more readable and most often also more detailed overview of each release. In this case: https://wiki.servoy.com/display/Serv7/New+in+7.4

Paul

It is currently missing in the JSFoundset API documentation.

Hi Paul, great to see you’re still around :D

As Paul said, the iterator has not been implemented to loop faster on a foundset and based on my benchmarking actually is not.

Servoy 7.4.2 introduces performance improvments when looping on thousand of records, this is why, Marco, your execution time dropped from 10 minutes to 3 minutes.

Marco looping on a foundset with a normal loop on 7.4.2 should not be slower then the iterator, have you already made this kind of test ?