Simple alternative to String.format().
This purposefully supports only a small handful of substitutions to improve execution speed. Benchmarking reveals this optimized alternative performs 6.5x faster for a typical format string. Add Preconditions overloads that accept varargs to avoid string formatting overhead in successful case. Bug: 170978902 Test: atest FrameworksCoreTests:android.text.TextUtilsTest Test: ./frameworks/base/libs/hwui/tests/scripts/prep_generic.sh little && atest CorePerfTests:android.text.TextUtilsPerfTest Change-Id: I3fae4dc95cfc98a61c4a7f07ca0781c4a2ee3be9
Loading
Please register or sign in to comment