Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "subtask" variants of start, stop, and event #23

Merged
merged 1 commit into from Nov 7, 2019

Conversation

@carl-mastrangelo
Copy link
Member

carl-mastrangelo commented Nov 7, 2019

Sub tasks are meant for use when the task name is a concatenation of two, runtime constant
strings, but the caller doesn't want to pay the allocation cost. None of these methods
support Tag overloads, and instead expect callers to invoke attachTag instead.

Perf:

Benchmark                                                  Mode  Cnt   Score   Error  Units
VarHandleGeneratorBenchmark.getAndSetAndGetGeneration      avgt    5   2.610 ± 0.022  ns/op
VarHandleGeneratorBenchmark.getGeneration                  avgt    5   2.379 ± 0.330  ns/op
VarHandleGeneratorBenchmark.racyGetAndSetAndGetGeneration  avgt    5  21.905 ± 2.327  ns/op
VarHandleMarkHolderBenchmark.event_name_noTag              avgt    5   3.581 ± 0.178  ns/op
VarHandleMarkHolderBenchmark.event_name_subname            avgt    5   4.131 ± 0.058  ns/op
VarHandleMarkHolderBenchmark.event_name_tag                avgt    5   4.417 ± 0.083  ns/op
VarHandleMarkHolderBenchmark.link                          avgt    5   2.301 ± 0.038  ns/op
VarHandleMarkHolderBenchmark.start_name_noTag              avgt    5   3.460 ± 0.048  ns/op
VarHandleMarkHolderBenchmark.start_name_subname            avgt    5   3.987 ± 0.090  ns/op
VarHandleMarkHolderBenchmark.start_name_tag                avgt    5   4.448 ± 0.082  ns/op
VarHandleMarkHolderBenchmark.stop_name_noTag               avgt    5   3.505 ± 0.042  ns/op
VarHandleMarkHolderBenchmark.stop_name_subname             avgt    5   4.019 ± 0.056  ns/op
VarHandleMarkHolderBenchmark.stop_name_tag                 avgt    5   4.503 ± 0.054  ns/op

Benchmark                                                 Mode  Cnt   Score   Error  Units
SynchronizedMarkHolderBenchmark.event_name_noTag          avgt    5   5.910 ± 0.077  ns/op
SynchronizedMarkHolderBenchmark.event_name_subname        avgt    5   7.843 ± 0.064  ns/op
SynchronizedMarkHolderBenchmark.event_name_tag            avgt    5   9.060 ± 0.116  ns/op
SynchronizedMarkHolderBenchmark.link                      avgt    5   3.474 ± 0.051  ns/op
SynchronizedMarkHolderBenchmark.start_name_noTag          avgt    5   5.849 ± 0.067  ns/op
SynchronizedMarkHolderBenchmark.start_name_subname        avgt    5   7.791 ± 0.093  ns/op
SynchronizedMarkHolderBenchmark.start_name_tag            avgt    5   9.105 ± 0.176  ns/op
SynchronizedMarkHolderBenchmark.stop_name_noTag           avgt    5   6.595 ± 0.109  ns/op
SynchronizedMarkHolderBenchmark.stop_name_subname         avgt    5   7.993 ± 0.071  ns/op
SynchronizedMarkHolderBenchmark.stop_name_tag             avgt    5   9.195 ± 0.082  ns/op
VolatileGeneratorBenchmark.getAndSetAndGetGeneration      avgt    5   7.712 ± 0.121  ns/op
VolatileGeneratorBenchmark.getGeneration                  avgt    5   2.262 ± 0.012  ns/op
VolatileGeneratorBenchmark.ifEnabled                      avgt    5   0.692 ± 0.007  ns/op
VolatileGeneratorBenchmark.racyGetAndSetAndGetGeneration  avgt    5  93.333 ± 2.295  ns/op
Sub tasks are meant for use when the task name is a concatenation of two, runtime constant
strings, but the caller doesn't want to pay the allocation cost.  None of these methods
support Tag overloads, and instead expect callers to invoke attachTag instead.

Perf:

```
Benchmark                                                  Mode  Cnt   Score   Error  Units
VarHandleGeneratorBenchmark.getAndSetAndGetGeneration      avgt    5   2.610 ± 0.022  ns/op
VarHandleGeneratorBenchmark.getGeneration                  avgt    5   2.379 ± 0.330  ns/op
VarHandleGeneratorBenchmark.racyGetAndSetAndGetGeneration  avgt    5  21.905 ± 2.327  ns/op
VarHandleMarkHolderBenchmark.event_name_noTag              avgt    5   3.581 ± 0.178  ns/op
VarHandleMarkHolderBenchmark.event_name_subname            avgt    5   4.131 ± 0.058  ns/op
VarHandleMarkHolderBenchmark.event_name_tag                avgt    5   4.417 ± 0.083  ns/op
VarHandleMarkHolderBenchmark.link                          avgt    5   2.301 ± 0.038  ns/op
VarHandleMarkHolderBenchmark.start_name_noTag              avgt    5   3.460 ± 0.048  ns/op
VarHandleMarkHolderBenchmark.start_name_subname            avgt    5   3.987 ± 0.090  ns/op
VarHandleMarkHolderBenchmark.start_name_tag                avgt    5   4.448 ± 0.082  ns/op
VarHandleMarkHolderBenchmark.stop_name_noTag               avgt    5   3.505 ± 0.042  ns/op
VarHandleMarkHolderBenchmark.stop_name_subname             avgt    5   4.019 ± 0.056  ns/op
VarHandleMarkHolderBenchmark.stop_name_tag                 avgt    5   4.503 ± 0.054  ns/op

Benchmark                                                 Mode  Cnt   Score   Error  Units
SynchronizedMarkHolderBenchmark.event_name_noTag          avgt    5   5.910 ± 0.077  ns/op
SynchronizedMarkHolderBenchmark.event_name_subname        avgt    5   7.843 ± 0.064  ns/op
SynchronizedMarkHolderBenchmark.event_name_tag            avgt    5   9.060 ± 0.116  ns/op
SynchronizedMarkHolderBenchmark.link                      avgt    5   3.474 ± 0.051  ns/op
SynchronizedMarkHolderBenchmark.start_name_noTag          avgt    5   5.849 ± 0.067  ns/op
SynchronizedMarkHolderBenchmark.start_name_subname        avgt    5   7.791 ± 0.093  ns/op
SynchronizedMarkHolderBenchmark.start_name_tag            avgt    5   9.105 ± 0.176  ns/op
SynchronizedMarkHolderBenchmark.stop_name_noTag           avgt    5   6.595 ± 0.109  ns/op
SynchronizedMarkHolderBenchmark.stop_name_subname         avgt    5   7.993 ± 0.071  ns/op
SynchronizedMarkHolderBenchmark.stop_name_tag             avgt    5   9.195 ± 0.082  ns/op
VolatileGeneratorBenchmark.getAndSetAndGetGeneration      avgt    5   7.712 ± 0.121  ns/op
VolatileGeneratorBenchmark.getGeneration                  avgt    5   2.262 ± 0.012  ns/op
VolatileGeneratorBenchmark.ifEnabled                      avgt    5   0.692 ± 0.007  ns/op
VolatileGeneratorBenchmark.racyGetAndSetAndGetGeneration  avgt    5  93.333 ± 2.295  ns/op
```
@carl-mastrangelo carl-mastrangelo merged commit f9962c4 into perfmark:master Nov 7, 2019
@carl-mastrangelo carl-mastrangelo deleted the carl-mastrangelo:subtask branch Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.