Optimize IPRange::Glob#each
to use a single format string to format each IP
#494
Labels
enhancement
Enhancement to existing code
help-wanted
Extra attention is needed
ip-range
IPRange
network
Network
optimization
Performance Optimization
Using
String#%
to format an Array of values with a C-style format string is faster than formatting each individual value and joining them usingArray#join
. This will require parsing the glob string and building the@ranges
Array and dynamically building a format string. Note that while IPv4 addresses can always be formatted using"%d.%d.%d.%d"
, IPv6 addresses may be truncated (ex:11:22::0-10:*
) and may contain 2 - 8 octets.Micro-Benchmark
The text was updated successfully, but these errors were encountered: