- Removed NSLog in NBPhoneNumberParsingPerfTest
- Converted isNan from a method to a function.
- isNan is now only checking for integer value instead of a float, as the intended use for the function is to remove non-geological calling code, which can only be an integer.
New JSON metadata generator that can be run directly from command line (using `swift` command) without any dependencies — however, currently, this must be run on the Mac.
This generator pulls in metadata, metadata for testing, and short number metadata directly from the latest commit on canonical libPhoneNumber GitHub repo.
Improve phone number parsing performance by:
- Using NSCache to cache metadata, so when parsing phone numbers from different regions, the metadata cache is still going to be valid.
- Improve various methods in NBPhoneNumberUtil by removing redundant operations, or using a different construct that’s more performant (such as using NSCharacterSet instead of NSScanner to check if a string is a number).
Also added a performance test that reads sample phone numbers from the metadata, and parse them.
Performance improvement result:
Machine:
Mac Pro (Late 2013)
2.7 GHz. 12-Core Intel Xeon E5
64 GB 1866 MHz DDR3
macOS High Sierra 10.13.3
Phone number to parse count: 2688
Baseline (5 runs -- in seconds):
0.362
0.372
0.385
0.363
0.365
After Change (5 runs -- in seconds):
0.312 (14% faster)
0.315 (13% faster)
0.317 (12% faster)
0.327 (10% faster)
0.308 (15% faster)
Improve phone number parsing performance by:
- Using NSCache to cache metadata, so when parsing phone numbers from different regions, the metadata cache is still going to be valid.
- Improve various methods in NBPhoneNumberUtil by removing redundant operations, or using a different construct that’s more performant (such as using NSCharacterSet instead of NSScanner to check if a string is a number).
Also added a performance test that reads sample phone numbers from the metadata, and parse them.
Performance improvement result:
Machine:
Mac Pro (Late 2013)
2.7 GHz. 12-Core Intel Xeon E5
64 GB 1866 MHz DDR3
macOS High Sierra 10.13.3
Phone number to parse count: 2688
Baseline (5 runs -- in seconds):
0.362
0.372
0.385
0.363
0.365
After Change (5 runs -- in seconds):
0.312 (14% faster)
0.315 (13% faster)
0.317 (12% faster)
0.327 (10% faster)
0.308 (15% faster)
Improve phone number parsing performance by:
- Using NSCache to cache metadata, so when parsing phone numbers from different regions, the metadata cache is still going to be valid.
- Improve various methods in NBPhoneNumberUtil by removing redundant operations, or using a different construct that’s more performant (such as using NSCharacterSet instead of NSScanner to check if a string is a number).
Also added a performance test that reads sample phone numbers from the metadata, and parse them.
Performance improvement result:
Machine:
Mac Pro (Late 2013)
2.7 GHz. 12-Core Intel Xeon E5
64 GB 1866 MHz DDR3
macOS High Sierra 10.13.3
Phone number to parse count: 2688
Baseline (5 runs -- in seconds):
0.362
0.372
0.385
0.363
0.365
After Change (5 runs -- in seconds):
Serial Parsing:
0.312 (14% faster)
0.315 (13% faster)
0.317 (12% faster)
0.327 (10% faster)
0.317 (12% faster)
- Add NSError ** parameter to -[NBRegularExpressionCache regularExpressionForPattern:error] method.
- Consolidating the expansion of gzipped data into one method.