Skip to content

TransformMap helper

Mikhail Mazurskiy requested to merge ash2k/transform-map into master

This helper will be used in even more places, e.g. in the upcoming MR: Send events to enable internal event tracking (!1181 - merged).

No changes in BenchmarkValuesMapToMeta since the code does the same thing as before:

old:
BenchmarkValuesMapToMeta-10    	 3578012	       313.4 ns/op	     560 B/op	       3 allocs/op

new:
BenchmarkValuesMapToMeta-10    	 3345140	       330.9 ns/op	     560 B/op	       3 allocs/op

However, BenchmarkMetaToValuesMap shows us that MetaToValuesMap() performs fewer allocations using the new helper. Note that the amount of allocated memory is the same.

old:
BenchmarkMetaToValuesMap-10    	 2262099	       509.5 ns/op	     800 B/op	      13 allocs/op

new:
BenchmarkMetaToValuesMap-10    	 2423511	       475.2 ns/op	     800 B/op	       9 allocs/op

Merge request reports