go-signalcontext.git
3 years agoAdd project documentation and licensing master
Joe Wreschnig [Sat, 13 Jun 2020 20:41:05 +0000 (22:41 +0200)]
Add project documentation and licensing

3 years agoReuse the same channel for all precompleted contexts
Joe Wreschnig [Sat, 13 Jun 2020 15:41:23 +0000 (17:41 +0200)]
Reuse the same channel for all precompleted contexts

This avoids making a new channel and immediately closing it. `benchcmp`
says:

    benchmark                      old ns/op     new ns/op     delta
    BenchmarkPrecompleted-4        213           138           -35.21%

    benchmark                      old allocs    new allocs    delta
    BenchmarkPrecompleted-4        3             2             -33.33%

    benchmark                      old bytes     new bytes     delta
    BenchmarkPrecompleted-4        176           80            -54.55%

3 years agoAdd a benchmark for precompleted context creation
Joe Wreschnig [Sat, 13 Jun 2020 15:45:28 +0000 (17:45 +0200)]
Add a benchmark for precompleted context creation

3 years agoImprove Error.Error() performance
Joe Wreschnig [Sat, 13 Jun 2020 15:32:04 +0000 (17:32 +0200)]
Improve Error.Error() performance

‘fmt’ is unnecessary to concatenate two strings. `benchcmp` says:

    BenchmarkError-4               226           65.8          -70.88%

3 years agoRemove ‘Signal’ from structure names
Joe Wreschnig [Sat, 13 Jun 2020 15:12:54 +0000 (17:12 +0200)]
Remove ‘Signal’ from structure names

The package is already named ‘signalcontext’, there’s no reason to
further scope `SignalError` or `SignalContext`.

Split error code and tests into a separate file.

3 years agoInitial import
Joe Wreschnig [Sat, 13 Jun 2020 07:13:34 +0000 (09:13 +0200)]
Initial import