Structure upsert queries to take advantage of the DFE engine
You can significantly improve the performance of upsert queries by taking advantage of the Neptune DFE engine as fully as possible.
Making efficient upserts with Gremlin mergeV() and mergeE() steps explains how to structure upsert queries to use the DFE engine as effectively as possible.