Skip to content

Instantly share code, notes, and snippets.

@eczarny
eczarny / gist:d549ce9e2d8462b78c58d1ccd4385bab
Last active Apr 10, 2017
Changeset verification benchmark; insertions w/ pending asynchronous modifications
View gist:d549ce9e2d8462b78c58d1ccd4385bab
FOUNDATION_EXPORT uint64_t dispatch_benchmark(size_t count, void (^block)(void));

- (void)test_changesetVerificationBenchmark
{
  const auto initialState = [[CKTransactionalComponentDataSourceState alloc] initWithConfiguration:nil sections:@[@[]]];
  auto pendingAsynchronousModifications = @[];
  for (NSInteger i = 0; i < 100; i++) {
    const auto insertedItems = generateInsertedItems([NSString stringWithFormat:@"A%ld-", i], i, 10, 0);
    const auto changeset =
@eczarny
eczarny / gist:d3b9f980ac4c6e09e7961ce464b85a2b
Last active Apr 10, 2017
Changeset verification benchmark; insertions w/o pending asynchronous modifications
View gist:d3b9f980ac4c6e09e7961ce464b85a2b
FOUNDATION_EXPORT uint64_t dispatch_benchmark(size_t count, void (^block)(void));

- (void)test_changesetVerificationBenchmark
{
  auto nextState = [[CKTransactionalComponentDataSourceState alloc] initWithConfiguration:nil sections:@[@[]]];
  for (NSInteger i = 0; i < 100; i++) {
    const auto insertedItems = generateInsertedItems([NSString stringWithFormat:@"A%ld-", i], i, 10, 0);
    const auto changeset =
    [[[CKTransactionalComponentDataSourceChangesetBuilder transactionalComponentDataSourceChangeset]
View gist:bf90fb01f0eafa08c739

Keybase proof

I hereby claim:

  • I am eczarny on github.
  • I am eczarny (https://keybase.io/eczarny) on keybase.
  • I have a public key whose fingerprint is 4384 7F21 9788 67C0 98A3 A404 0409 0F65 AA64 2BC9

To claim this, I am signing this object: