Skip to content

Add benchmark for name translation#86

Merged
pglass merged 1 commit intomainfrom
pglass/translator-benchmark
Jun 4, 2025
Merged

Add benchmark for name translation#86
pglass merged 1 commit intomainfrom
pglass/translator-benchmark

Conversation

@pglass
Copy link
Copy Markdown
Contributor

@pglass pglass commented Jun 4, 2025

What was changed

Add a benchmark test for the reflection-based name translation

Why?

Checklist

  1. Closes

  2. How was this tested:

  • make bench - (also runs another benchmark)
  • BENCH_ARG="-bench '^BenchmarkVisitNamespace' -benchtime=5000x" make bench - just run the new bench function
BenchmarkVisitNamespace/Namespace_field/name_changed-14                     5000               860.8 ns/op           240 B/op          6 allocs/op
BenchmarkVisitNamespace/Namespace_field/name_unchanged-14                   5000               720.1 ns/op           224 B/op          5 allocs/op
BenchmarkVisitNamespace/WorkflowNamespace_field/name_changed-14             5000               710.8 ns/op           240 B/op          6 allocs/op
BenchmarkVisitNamespace/WorkflowNamespace_field/name_unchanged-14                   5000               632.7 ns/op           224 B/op          5 allocs/op
BenchmarkVisitNamespace/Nested_Namespace_field/name_changed-14                      5000              1186 ns/op             512 B/op         11 allocs/op
BenchmarkVisitNamespace/Nested_Namespace_field/name_unchanged-14                    5000               972.0 ns/op           496 B/op         10 allocs/op
BenchmarkVisitNamespace/list_of_structs/name_changed-14                             5000              1359 ns/op             584 B/op         12 allocs/op
BenchmarkVisitNamespace/list_of_structs/name_unchanged-14                           5000              1176 ns/op             568 B/op         11 allocs/op
BenchmarkVisitNamespace/list_of_ptrs/name_changed-14                                5000              1398 ns/op             648 B/op         13 allocs/op
BenchmarkVisitNamespace/list_of_ptrs/name_unchanged-14                              5000              1230 ns/op             632 B/op         12 allocs/op
BenchmarkVisitNamespace/RespondWorkflowTaskCompletedRequest/name_changed-14                 5000              7772 ns/op           11048 B/op         74 allocs/op
BenchmarkVisitNamespace/RespondWorkflowTaskCompletedRequest/name_unchanged-14               5000              7656 ns/op           11000 B/op         71 allocs/op
BenchmarkVisitNamespace/PollWorkflowTaskQueueResponse/name_changed-14                       5000              5436 ns/op            5984 B/op         55 allocs/op
BenchmarkVisitNamespace/PollWorkflowTaskQueueResponse/name_unchanged-14                     5000              5183 ns/op            5968 B/op         54 allocs/op
BenchmarkVisitNamespace/GetWorkflowExecutionRawHistoryV2Response/name_changed-14            5000             22405 ns/op           39648 B/op        313 allocs/op
BenchmarkVisitNamespace/GetWorkflowExecutionRawHistoryV2Response/name_unchanged-14          5000             21075 ns/op           37992 B/op        284 allocs/op
BenchmarkVisitNamespace/DescribeNamespaceResponse/name_changed-14                           5000              2641 ns/op            2656 B/op         22 allocs/op
BenchmarkVisitNamespace/DescribeNamespaceResponse/name_unchanged-14                         5000              2776 ns/op            2656 B/op         22 allocs/op
BenchmarkVisitNamespace/UpdateNamespaceResponse/name_changed-14                             5000              5229 ns/op            5704 B/op         45 allocs/op
BenchmarkVisitNamespace/UpdateNamespaceResponse/name_unchanged-14                           5000              5046 ns/op            5704 B/op         45 allocs/op
BenchmarkVisitNamespace/ListNamespacesResponse/name_changed-14                              5000              3345 ns/op            2976 B/op         30 allocs/op
BenchmarkVisitNamespace/ListNamespacesResponse/name_unchanged-14                            5000              3353 ns/op            2976 B/op         30 allocs/op
BenchmarkVisitNamespace/StreamWorkflowReplicationMessagesResponse/name_changed-14           5000            103102 ns/op          178443 B/op       1638 allocs/op
BenchmarkVisitNamespace/StreamWorkflowReplicationMessagesResponse/name_unchanged-14         5000             99668 ns/op          170203 B/op       1494 allocs/op
BenchmarkVisitNamespace/circular_pointer/name_changed-14                                    5000              1273 ns/op             592 B/op         13 allocs/op
BenchmarkVisitNamespace/circular_pointer/name_unchanged-14                                  5000              1101 ns/op             560 B/op         11 allocs/op
  1. Any docs updates needed?

@pglass pglass requested a review from hehaifengcn June 4, 2025 16:18
@pglass pglass requested a review from a team as a code owner June 4, 2025 16:18
@pglass pglass force-pushed the pglass/translator-benchmark branch from 10281d8 to 01c7673 Compare June 4, 2025 16:41
@hehaifengcn
Copy link
Copy Markdown
Collaborator

what are the results?

@pglass pglass merged commit 1ef414b into main Jun 4, 2025
8 checks passed
@pglass pglass deleted the pglass/translator-benchmark branch June 4, 2025 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants