Optimize history records for a workflow with all local activities

Yes, I got it @tihomir that worked, appreciate your code snippet anyway.
Also, to make use of the “doNotIncludeArgumentsIntoMarker” on LocalActivityOptions, I was earlier using 0.29.1 Java SDK but I upgraded that to 1.0.8 which seems to be the version when it was introduced. However I get this error:

Exception in thread "main" java.lang.NoSuchMethodError: 'void com.google.common.base.Preconditions.checkArgument(boolean, java.lang.String, char, java.lang.Object)'
	at io.grpc.Metadata$Key.validateName(Metadata.java:742)
	at io.grpc.Metadata$Key.<init>(Metadata.java:750)
	at io.grpc.Metadata$Key.<init>(Metadata.java:668)
	at io.grpc.Metadata$AsciiKey.<init>(Metadata.java:959)
	at io.grpc.Metadata$AsciiKey.<init>(Metadata.java:954)
	at io.grpc.Metadata$Key.of(Metadata.java:705)
	at io.grpc.Metadata$Key.of(Metadata.java:701)
	at io.temporal.serviceclient.WorkflowServiceStubsImpl.<clinit>(WorkflowServiceStubsImpl.java:51)

I see suggestions to upgrade guava but I see the version is already the latest in mvn dependencies:
com.google.guava:guava:jar:30.1.1-jre:compile

I have tried java sdk 1.0.0, 1.0.8, 1.2.0 but 0.29.1 is the only one that’s working for me. Have you seen this issue?

The worker is running on Temporal server 1.9.2 version.