MCPcopy Index your code
hub / github.com/parse-community/parse-server / benchmarkBatchSave

Function benchmarkBatchSave

benchmark/performance.js:417–437  ·  view source on GitHub ↗

* Benchmark: Batch Save (saveAll)

(name)

Source from the content-addressed store, hash-verified

415 * Benchmark: Batch Save (saveAll)
416 */
417async function benchmarkBatchSave(name) {
418 const BATCH_SIZE = 10;
419
420 return measureOperation({
421 name,
422 iterations: 1_000,
423 operation: async () => {
424 const TestObject = Parse.Object.extend('BenchmarkTest');
425 const objects = [];
426
427 for (let i = 0; i < BATCH_SIZE; i++) {
428 const obj = new TestObject();
429 obj.set('batchField', `batch-${i}`);
430 obj.set('timestamp', new Date());
431 objects.push(obj);
432 }
433
434 await Parse.Object.saveAll(objects);
435 },
436 });
437}
438
439/**
440 * Benchmark: User Signup

Callers

nothing calls this directly

Calls 1

measureOperationFunction · 0.85

Tested by

no test coverage detected