Skip to content

Conversation

@themiron
Copy link

@themiron themiron commented Oct 2, 2024

It's useful for cases where walk needs to stop after Nth found network w/o traversing the whole network list.
Accodrding bench, it's even faster than current goroutine-based variant:

  Benchmark_CoveredNetworksAsync/IPTrie-12   2  829524748 ns/op  10000 batch_size
  Benchmark_CoveredNetworksSync/IPTrie-12   91   13892012 ns/op  10000 batch_size

With stop after the first found, it's obviously faster too:

  Benchmark_CoveredNetworksAsync/IPTrie-12  2        804893434 ns/op  10000 batch_size
  Benchmark_CoveredNetworksSync/IPTrie-12   2740110  443.1 ns/op      10000 batch_size

It's useful for cases where walk needs to stop after Nth found network
w/o traversing the whole network list.
Accodrding bench, it's even faster than current goroutine-based variant:

  Benchmark_CoveredNetworksAsync/IPTrie-12   2  829524748 ns/op  10000 batch_size
  Benchmark_CoveredNetworksSync/IPTrie-12   91   13892012 ns/op  10000 batch_size

With stop after the first found, it's obviously faster too:

  Benchmark_CoveredNetworksAsync/IPTrie-12  2        804893434 ns/op  10000 batch_size
  Benchmark_CoveredNetworksSync/IPTrie-12   2740110  443.1 ns/op      10000 batch_size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant