Skip to content

Benchmarking reflection API calls, via ReportAllocs() #506

@advancedwebdeveloper

Description

@advancedwebdeveloper

Hi.

I have applied such a patch - and it allowed to build, test the project:

https://gist.github.com/advancedwebdeveloper/bda9cfc45c8e133464f5eea9a4f0e50e
.

@ianlancetaylor proposed such a benchmarking option:
https://groups.google.com/g/golang-nuts/c/S2gBW3BV4QU/m/uW9KN7AuFwAJ
https://golang.org/pkg/testing/#B.ReportAllocs
.

I see such lines, which invoked the reflection API:

defaultHeader := reflect.TypeOf(collection).String()

WEB_SECURE_ANNOT, reflect.TypeOf(existingSecret), reflect.TypeOf(secureSecret))

"verbs": reflect.ValueOf(whisk.ApiVerbs).MapKeys()})

.

What is the minimal scenario, to perform a strictly bench-marking test?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions