Commit Graph

20 Commits

Author SHA1 Message Date
Facundo Medica
c57dde2f34
feat!: migrate x/group to store service (#19410) 2024-02-13 13:51:26 +00:00
Dev Ojha
ac48269f98
perf: Speedup sdk.Int overflow checks (#19386) 2024-02-09 08:51:11 +00:00
ocnc
7d5e9f1c23
feat(math): add safe arithmetic (#18552) 2023-11-28 07:54:04 +00:00
Hieu Vu
e7e1c36222
feat(math): Add mutative api for NewIntFromBigInt (#18030) 2023-11-07 08:36:39 +00:00
Hieu Vu
150013ee50
feat(math): add mutative api for Int.BigInt() (#17803) 2023-09-25 12:12:23 +00:00
Elias Naur
2f098de32f
chore: add failing test for math.Int.Size (#17747)
Co-authored-by: Julien Robert <julien@rbrt.fr>
2023-09-14 20:51:42 +00:00
Roman
f304ebfc8f
fix(math): Revert "perf: optimize math.Int.Size for small values (#17497)" (#17736) 2023-09-14 16:55:58 +00:00
Elias Naur
952328a4ed
perf: optimize math.Int.Size for small values (#17497) 2023-08-22 21:54:34 +00:00
Julien Robert
bf249162e4
fix(math): revert #16263 and add test cases (#17489) 2023-08-21 14:07:40 +00:00
Julien Robert
1089f715fc
fix(math): fix panic in .Size() (#17480) 2023-08-21 09:20:30 +00:00
Aleksandr Bezobchuk
658a88a309
fix(math): defend NewIntFromBigInt argument mutation (#17352) 2023-08-10 20:10:38 +00:00
Emmanuel T Odeke
9b9e319d1a
perf: math: make Int.Size() faster by computation not len(MarshalledBytes) (#16263)
Co-authored-by: marbar3778 <marbar3778@yahoo.com>
2023-06-08 15:15:52 +00:00
Facundo Medica
43cfdfe618
fix(math): FormatInt returns error on empty string (#15714) 2023-04-06 14:10:30 +00:00
Jeancarlo Barrios
8aa0d035d8
test(math): added integer file to fix test (#15490) 2023-03-20 22:55:34 +00:00
Julien Robert
d5d39c0538
fix: do not flatten events attributes by event types (#14691)
Co-authored-by: Aleksandr Bezobchuk <alexanderbez@users.noreply.github.com>
2023-01-19 19:42:46 +00:00
Emmanuel T Odeke
3e85182baa
perf: math: optimize and test FormatInt + simplify LegacyNewDecFromStr (#14010)
Optimizes and tests FormatInt by removing inefficient string
concatenation but also making it so much clearer with how one would
express adding thousand separators in natural language. It uses
a combination of strings.Builder whose values can be grown

The performance improvement is stark in every dimension:

```shell
$ benchstat before.txt after3.txt
name                          old time/op    new time/op    delta
DecimalValueRendererFormat-8    4.48µs ± 1%    2.11µs ± 2%  -52.90%  (p=0.000 n=10+10)

name                          old alloc/op   new alloc/op   delta
DecimalValueRendererFormat-8    3.62kB ± 0%    0.78kB ± 0%  -78.59%  (p=0.000 n=10+10)

name                          old allocs/op  new allocs/op  delta
DecimalValueRendererFormat-8      83.0 ± 0%      28.0 ± 0%  -66.27%  (p=0.000 n=10+10)
```

While here, also simplified zero padding for LegacyNewDecFromStr
simply by using strings.Repeat instead of a convoluted
fmt.Sprintf+strconv.Itoa.

Fixes #14008
Fixes #14003

Co-authored-by: Marko <marbar3778@yahoo.com>
2022-11-29 21:00:47 +00:00
Amaury
10ac33edb8
refactor: Move FormatCoins to core (#13306)
* refactor: Move FormatCoins to `core`

* Rename to shorter names

* Add chaneglog

* Don't panic

* add comments

* go mod tidy

* fix changelog

* move structs to top

* Fix test

* go mod tidy

* Refactor tests
2022-10-19 11:21:24 +00:00
Jacob Gadikian
55054282d2
chore: gofumpt (#11839)
* fumpt using main not master...

* be more descriptive

* fumpt

* fix nits

Co-authored-by: Julien Robert <julien@rbrt.fr>
2022-05-19 10:55:27 +02:00
Aleksandr Bezobchuk
51fd676950
chore: update module path for math module (#11821) 2022-04-29 10:02:55 -04:00
Aleksandr Bezobchuk
4f04beae34
refactor!: create math go sub module (#11788) 2022-04-28 14:05:21 -04:00