Commit Graph

5 Commits

Author SHA1 Message Date
Agniva De Sarker
2dba5dbf86 MM-21368: Optimize MapStringsToQueryParams (#13601)
- Use strings.Builder which minimizes allocations.
- Avoid fmt.Sprintf which is slower than simple string concat.

Results:

name                                      old time/op    new time/op    delta
MapStringsToQueryParams/one_item-8           512ns ± 2%     377ns ± 1%  -26.27%  (p=0.000 n=10+9)
MapStringsToQueryParams/multiple_items-8     858ns ± 5%     748ns ± 2%  -12.82%  (p=0.000 n=10+9)

name                                      old alloc/op   new alloc/op   delta
MapStringsToQueryParams/one_item-8            456B ± 0%      384B ± 0%  -15.79%  (p=0.000 n=10+9)
MapStringsToQueryParams/multiple_items-8      608B ± 0%      592B ± 0%   -2.63%  (p=0.000 n=10+10)

name                                      old allocs/op  new allocs/op  delta
MapStringsToQueryParams/one_item-8            8.00 ± 0%      6.00 ± 0%  -25.00%  (p=0.000 n=10+10)
MapStringsToQueryParams/multiple_items-8      12.0 ± 0%      12.0 ± 0%     ~     (all equal)
2020-01-09 07:44:01 -08:00
Jesús Espino
a63684fcb5 Consistent license message for all the go files (#13235)
* Consistent license message for all the go files

* Fixing the last set of unconsistencies with the license headers

* Addressing PR review comments

* Fixing busy.go and busy_test.go license header
2019-11-29 12:59:40 +01:00
aqche
54181e4015 Migrate tests from 'store/sqlstore/utils_test.go' to use testify (#12815) 2019-10-17 07:24:06 -07:00
Claudio Costa
814c234443 [MM-18036] Sanitize sql LIKE terms on search endpoints (#12044)
* Sanitize sql LIKE terms on search endpoints

* Add search term sanitization in additional places
2019-09-11 10:56:12 +02:00
Harrison Healey
48f16b6401 MM-11272 Added initial post metadata (#9175)
* MM-11272 Added app.PreparePostForClient

* MM-11272 Added app.PreparePostListForClient

* MM-11272 Added EmojiStore.GetMultipleByName

* MM-11272 Added emojis to PreparePostForClient

* MM-11272 Added unit tests for getting reaction counts

* MM-11272 Added unit tests for TestPreparePostForClient

* MM-11272 Added emojis from reactions to Post.Emojis

* MM-11272 Always update post.UpdateAt when reactions change to bust cache

* Fixed merge conflicts

* Moved post metadata-related code into its own file

* Update store mocks

* Fixed typo

* Add missing license headers

* Updated post metadata tests when custom emojis are disabled

* Fix unreliable unit tests

* Fix inconsistent casing in SQL statements

* Fix blank line

* Invalidate store cache after making changes

* Clear post cache synchronously with reactions
2018-11-01 15:22:33 -04:00