Hi Erica -
I've implemented this in a draft GP service.
It's super straightforward, and it works. However there are a couple of things to report back -
1 - it does indeed add time to the GP tool returning results - went from 3.5 seconds to about 6 seconds in our case.
2 - in this case, I actually needed to use 2 FeatureClassToFeatureClass_conversion tools - the first allows you to delete fields from it. However - when publishing the GP service with this as the output dataset, it still returns all of the fields, including those that were deleted. Again, looking at the GP service REST end point, it does look correct - the deleted fields are not shown, but they are in the JSON results. So, you actually need to create another in_memory feature class after dropping the fields - this one will be 'clean' and when used as the output of the GP tool only includes the desired fields.
3 - Even though the feature classes are in_memory, they are 'sticky' as far as holding on to data from a previous run of the tool. So, for each in_memory feature class, I added:
if arcpy.exists(in_memory_fc):
Delete_management(in_memory_fc)
these are at the beginning of the script, to ensure the tool does not actually just return the same results from the last run.
Thanks -
Allen