Think² logoThink²
Sign in

Guides (Spanish)

Before batching work, measure how long each item can wait

A batch finishing correctly does not mean every item finished on time. In a local test with twelve items, waiting for 200 ms windows preserved outputs but left four items beyond a pre-set teaching deadline of 120 ms in each batched run. This delay was a design choice, not a service failure or a comparison with Think².

Waitlist, no immediate access or free plan guaranteed. The destination is in Spanish.

Situations to review

A batch delivers every output, but some arrive after the deadline.

We scheduled 12 items every 50 ms, from J01 at 0 ms to J12 at 550 ms. Fixed 200 ms windows produced groups of 5, 4 and 3. In each of the three batched runs, 8 of 12 items finished within the pre-set 120 ms deadline, although all 12 outputs were complete.

Output integrity and deadline compliance are separate criteria. Reporting ‘12 processed’ alone would hide the four late items. This is a local teaching threshold, not a customer SLA.

Two items in the same batch experience very different waits.

In the first batched run, J01 finished 205.608489 ms after its scheduled arrival; J05 finished 5.945092 ms after its own, although both were processed in the first group. The rule includes an item scheduled exactly at the closing boundary; the script also records its observed arrival.

One batch duration does not represent each item’s experience. Keep scheduled arrival, observed arrival, start and finish to distinguish designed waiting from scheduler delays.

CPU time looks small, but the user has waited much longer.

Batched wall times were 600.441–600.520 ms; process CPU times were 2.252–2.697 ms. Most elapsed time was not transformation CPU. The CPU measure covers the whole process, including producer and worker, not a bill.

These values cannot establish a price, cloud saving or production capacity. Wall time alone does not establish monetary cost without a model and measurements for the actual service either.

Waitlist, no immediate access or free plan guaranteed. The destination is in Spanish.

How to evaluate the work

  1. Protocol fixed before execution: twelve synthetic payloads entrada-01 through entrada-12; scheduled arrivals every 50 ms; the same SHA256 transformation per item. One route processes on arrival using a sequential worker; the other waits for fixed 200 ms closing boundaries from the start. We added no artificial per-request overhead to manufacture savings. The immediate route is not a real-time system or response guarantee.
  2. Six complete runs were executed in this order: immediate, 200 ms window, 200 ms window, immediate, immediate, 200 ms window. All were kept, without retries or selecting the best. Python 3.13.5 on Linux aarch64; 72 item observations, not 72 customers or a business-load sample. Each run had 12 unique IDs, with identical outputs across all six. This English article is an editorial translation, not another set of runs.
  3. Original results, milliseconds to 3 decimal places. run | policy | latency min / median / max ms | deadline /12 | wall ms | process CPU ms 1 | inmediata | 0.312 / 0.350 / 0.488 | 12/12 | 550.345 | 3.685 2 | ventana200ms | 0.608 / 100.419 / 205.608 | 8/12 | 600.520 | 2.697 3 | ventana200ms | 0.571 / 100.401 / 200.338 | 8/12 | 600.483 | 2.553 4 | inmediata | 0.284 / 0.323 / 0.539 | 12/12 | 550.382 | 3.221 5 | inmediata | 0.255 / 0.277 / 0.329 | 12/12 | 550.346 | 2.827 6 | ventana200ms | 0.542 / 100.373 / 200.312 | 8/12 | 600.441 | 2.252
  4. Latency here is transformation finish minus scheduled arrival; it includes waiting and scheduler delays. The JSON also retains observed arrival and latency measured from it. The deadline was fixed at 120 ms before the test; an item passes when latency ≤120 ms. Medians are per run. We performed no statistical-significance analysis or sustainable production-rate estimate. The numbers describe this design and these inputs, not a universal architecture ranking.
  5. The first window includes five items because an arrival scheduled exactly at 200 ms belongs to that closing boundary. If the producer has not yet enqueued it, the worker waits for that item. Actual times are reported. This is neither a provider micro-batch nor a universal windowing policy. Do not change the convention after inspecting results.
  6. Python’s official documentation distinguishes perf_counter_ns, for durations including waiting, from process_time_ns, user/system CPU of the process excluding sleeping time. Both are used through differences between readings. Neither measures monetary cost by itself. We measured no tariffs, network, storage, failures, retries, heavy concurrency or cloud performance. This limited test does not establish monetary cost or performance under production load and is insufficient to determine your service’s capacity or cost.
  7. To evaluate your process, decide which items need an immediate answer and which can wait; fix the per-item deadline, batch size or window, boundary treatment and load conditions. Keep every output and inspect both integrity and lateness. If you expect fewer calls or amortisation of an actual cost, measure that mechanism: our script performs the same work per item and does not demonstrate such savings.
  8. Think² lets you organise collaborators, context and review with compatible models, authorised tools and an optional computer per collaborator. A deadline record can help prepare a reviewable decision, but this test ran no routines, queues or batches inside Think². It configures no service and does not promise that a collaborator will meet 120 ms or process a specified daily volume.

Download the evidence

Frequently asked questions

Does this show batching should always be avoided?

No. The window introduces waiting by design, and this test has no mechanism for amortising cost or calls. Other processes may accept the delay and benefit from a particular grouping method. You would need to measure it under your load and constraints; this sample neither proves nor rules out that benefit.

Does processing on arrival mean guaranteed real time?

No. It names a local sequential-worker policy with operating-system delays retained. The three immediate runs met the teaching deadline for these items; that guarantees neither future deadlines nor capacity under another load.

Will the download reproduce exactly the same milliseconds?

No. It includes the protocol, script and original results. Running the script repeats the local design; timings can vary with system and load. Inspect the code and use your own separate environment. It calls neither Think² nor a cloud service. A separate reproduction checked package extraction and execution in new directories; its results are kept apart and do not replace the original timings.

Sources and scope

  • Python — time — Clock definitions only; not monetary cost, cloud performance or Think².

Waitlist, no immediate access or free plan guaranteed. The destination is in Spanish.