Project

General

Profile

Actions

Task #5716

closed

Implement the possibility to process template code multiple times (e.g. atomic (:repeat => N) {})

Added by Andrei Tatarnikov almost 10 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
High
Assignee:
Andrei Tatarnikov
Category:
Template Processor
Target version:
Start date:
03/17/2015
Due date:
% Done:

100%

Estimated time:
Detected in build:
svn
Published in build:
2.3.12

Description

See my comments in Bug #5691. Need a construct like this:

atomic (:repeat => 1000000) {
  ...
}

This is needed to repeat fragments of a test template and gives the following advantages over the "1000000.times { ... }" Ruby construct, which is now used:

  • Only one copy which is processed N times (the iterator returns the same sequence N times).
  • No processor time is spent to create N identical objects (no time-consuming interactions between Ruby and Java).
  • No memory is wasted to store N identical objects.
  • This will work in any place in a test template (not only for top-level blocks)
Actions #1

Updated by Alexander Kamkin almost 10 years ago

  • Target version set to 2.3
Actions #2

Updated by Andrei Tatarnikov about 9 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Such a facility was implemented in r5633 (see also Task #6438). Syntax is the following:

atomic {
  ...
}.run(1000000) 
Actions #3

Updated by Andrei Tatarnikov about 9 years ago

  • Status changed from Resolved to Closed
  • Published in build set to 2.3.12
Actions

Also available in: Atom PDF