We have a slice containing a mix of data items, some of which are deemed to 
be 'valid', some 'invalid'. We need to remove the invalid items.

In the current implementation we have a function which takes the slice as 
input and removes the invalid' elements from it in place i.e. not from a 
copy.  So, after the function has completed, the slice will no longer 
contain any of the invalid elements.

We have alternative approaches to doing this but ideally we'd like to 
benchmark each. However we're struggling to set up the test data for this 
one because after the first call there will be no data to change - if the 
profiler were to call the function 1000 times, only the first call will 
have done any actual work. To make the benchmarked function do the same 
work each time we'd have to set up fresh data for each call to the 
function. We can do that but we don't want that setup to show in the timing 
for the benchmark.

Does anyone know of a solution to this?

TIA,
Orson

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/0678f930-e5de-4e2c-af6b-58d1ad51daae%40googlegroups.com.

Reply via email to