Commit Graph

8 Commits

Author SHA1 Message Date
wyrapeseed
abc305483d
refactor: use b.Loop() in benchmark tests for better performance (#25461)
Signed-off-by: wyrapeseed <wyrapeseed@outlook.com>
Co-authored-by: Alex | Cosmos Labs <alex@cosmoslabs.io>
2025-10-15 17:25:46 +00:00
maksneprik
cff39886e5
chore: fix grammatical errors in log package comments (#25155) 2025-08-12 17:44:55 +00:00
Hwangjae Lee
56775c81d0
fix(tests): resolve timer resource leaks causing "too many concurrent timer firings" panic (#25102)
Signed-off-by: Hwangjae Lee <meetrick@gmail.com>
Co-authored-by: Alex | Interchain Labs <alex@interchainlabs.io>
2025-08-06 15:43:59 +00:00
Alex | Interchain Labs
3c6deab626
chore: run modernize (#24356) 2025-04-03 10:42:20 -04:00
Jacob Gadikian
a9546bfad0
style: apply any / all automated lint fixes (#15644) 2023-03-31 13:48:41 +02:00
Jacob Gadikian
be8c5a09c2
chore: lint tests (#14268) 2022-12-18 23:48:31 +00:00
Cuong Manh Le
d3769b2fbc
internal/conv: fix wrong string to bytes implementation (#9141)
UnsafeStrToBytes is currently not safe for -d=checkptr=2, since when it
cast from smaller struct (string) to bigger struct ([]byte). That causes
checkptr complains as the casting straddle multiple heap objects.

To fix this, we have to get the string header first, then use its fields
to construct the slice.

New implementation performs the same speed with the old (wrong) one.

name                old time/op    new time/op    delta
UnsafeStrToBytes-8    25.7ns ± 1%    25.7ns ± 3%   ~     (p=0.931 n=10+17)

name                old alloc/op   new alloc/op   delta
UnsafeStrToBytes-8     7.00B ± 0%     7.00B ± 0%   ~     (all equal)

name                old allocs/op  new allocs/op  delta
UnsafeStrToBytes-8      0.00           0.00        ~     (all equal)

While at it, also simplify UnsafeBytesToStr implementation, since when
we can pass the slice directly to unsafe.Pointer, instead of getting the
slice header first.
2021-04-19 14:51:05 +01:00
Robert Zaremba
5f2b90c3c7
internal: create package for unsafe bytes convertion (#8733)
Co-authored-by: Alessio Treglia <alessio@tendermint.com>
2021-03-01 15:10:22 +00:00