Martin Möhrmann
fbfc2031a6
cmd/compile: specialize map creation for small hint sizes
...
Handle make(map[any]any) and make(map[any]any, hint) where
hint <= BUCKETSIZE special to allow for faster map initialization
and to improve binary size by using runtime calls with fewer arguments.
Given hint is smaller or equal to BUCKETSIZE in which case
overLoadFactor(hint, 0) is false and no buckets would be allocated by makemap:
* If hmap needs to be allocated on the stack then only hmap's hash0
field needs to be initialized and no call to makemap is needed.
* If hmap needs to be allocated on the heap then a new special
makehmap function will allocate hmap and intialize hmap's
hash0 field.
Reduces size of the godoc by ~36kb.
AMD64
name old time/op new time/op delta
NewEmptyMap 16.6ns ± 2% 5.5ns ± 2% -66.72% (p=0.000 n=10+10)
NewSmallMap 64.8ns ± 1% 56.5ns ± 1% -12.75% (p=0.000 n=9+10)
Updates #6853
Change-Id: I624e90da6775afaa061178e95db8aca674f44e9b
Reviewed-on: https://go-review.googlesource.com/61190
Run-TryBot: Martin Möhrmann <moehrmann@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
2017-11-02 17:03:45 +00:00
..
2017-01-20 05:55:53 +00:00
2017-03-22 03:23:16 +00:00
2017-09-15 02:39:16 +00:00
2016-05-02 13:43:18 +00:00
2017-10-30 20:27:09 +00:00
2016-05-02 13:43:18 +00:00
2015-10-07 14:37:44 +00:00
2017-04-24 12:37:49 +00:00
2017-03-16 02:44:16 +00:00
2016-04-03 17:03:15 +00:00
2017-02-08 20:59:45 +00:00
2014-01-07 13:26:48 +01:00
2016-05-02 13:43:18 +00:00
2017-02-24 18:54:36 +00:00
2016-07-06 20:48:41 +00:00
2016-04-24 21:36:52 +00:00
2016-05-02 13:43:18 +00:00
2017-01-25 08:04:17 +00:00
2017-01-20 05:55:53 +00:00
2016-05-02 13:43:18 +00:00
2017-04-24 12:37:49 +00:00
2017-05-11 13:53:54 +00:00
2014-10-06 17:16:39 -04:00
2016-03-17 04:20:02 +00:00
2013-02-12 13:17:49 -05:00
2015-12-02 18:26:38 +00:00
2013-10-08 14:36:20 -04:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-08-15 05:54:24 +00:00
2014-12-08 22:18:17 +00:00
2017-05-18 00:05:25 +00:00
2014-10-31 11:08:27 -04:00
2015-01-29 13:07:30 +00:00
2015-02-03 15:48:48 +00:00
2014-01-31 00:30:56 +01:00
2015-06-26 03:38:21 +00:00
2017-04-24 12:37:49 +00:00
2017-03-15 22:45:17 +00:00
2017-03-15 22:45:17 +00:00
2017-03-15 22:45:17 +00:00
2017-04-24 12:37:49 +00:00
2016-05-02 13:43:18 +00:00
2013-12-12 17:18:12 -08:00
2015-07-11 14:36:33 +00:00
2015-07-11 14:36:33 +00:00
2016-05-02 13:43:18 +00:00
2016-09-17 01:12:24 +00:00
2016-05-02 13:43:18 +00:00
2016-10-04 17:10:47 +00:00
2015-05-07 23:54:28 +00:00
2017-04-24 12:37:49 +00:00
2013-02-12 13:17:49 -05:00
2017-08-11 17:41:17 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2013-02-12 13:17:49 -05:00
2013-02-12 13:17:49 -05:00
2014-01-24 22:35:11 +04:00
2016-05-02 13:43:18 +00:00
2017-03-14 18:49:23 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-06-28 22:09:00 +00:00
2017-08-11 00:56:21 +00:00
2017-08-11 00:56:21 +00:00
2016-05-02 13:43:18 +00:00
2017-10-11 22:32:36 +00:00
2017-03-24 17:14:00 +00:00
2016-05-02 13:43:18 +00:00
2016-10-26 18:46:59 +00:00
2016-05-02 13:43:18 +00:00
2017-02-15 01:33:03 +00:00
2016-05-02 13:43:18 +00:00
2016-10-10 12:09:16 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2013-02-12 13:17:49 -05:00
2014-12-08 22:22:58 +00:00
2015-11-03 18:57:18 +00:00
2016-09-14 16:39:47 +00:00
2016-05-02 13:43:18 +00:00
2013-02-12 13:17:49 -05:00
2013-02-12 13:17:49 -05:00
2013-03-15 15:24:13 -04:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-04-19 02:27:58 +00:00
2015-11-12 18:32:13 +00:00
2013-12-12 19:02:11 -08:00
2016-05-02 13:43:18 +00:00
2017-03-24 20:07:15 +00:00
2017-02-10 01:22:30 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-03-06 23:48:37 +00:00
2017-04-24 12:37:49 +00:00
2015-09-05 02:25:01 +00:00
2017-04-18 19:56:30 +00:00
2017-10-31 13:19:38 +00:00
2017-03-03 21:29:32 +00:00
2016-11-30 19:46:00 +00:00
2017-10-11 22:32:36 +00:00
2017-10-10 19:43:38 +00:00
2016-09-19 19:03:01 +00:00
2017-04-12 14:27:45 +00:00
2016-05-02 13:43:18 +00:00
2015-12-17 23:36:13 +00:00
2016-05-02 13:43:18 +00:00
2017-02-08 20:59:45 +00:00
2016-05-09 17:31:45 +00:00
2016-04-20 17:37:35 +00:00
2016-05-02 13:43:18 +00:00
2013-02-12 13:17:49 -05:00
2016-05-02 13:43:18 +00:00
2017-11-02 17:03:45 +00:00
2016-10-31 19:38:50 +00:00
2017-11-02 17:03:45 +00:00
2017-04-05 18:46:31 +00:00
2017-06-21 22:07:33 +00:00
2017-08-15 05:54:24 +00:00
2017-08-22 20:28:21 +00:00
2017-04-24 12:37:49 +00:00
2017-04-24 12:37:49 +00:00
2014-08-06 17:02:55 -04:00
2014-10-27 18:59:02 -04:00
2017-09-03 14:29:38 +00:00
2016-03-17 00:38:15 +00:00
2017-10-12 20:50:20 +00:00
2016-05-02 13:43:18 +00:00
2017-10-12 20:50:20 +00:00
2017-10-26 03:47:37 +00:00
2013-02-11 18:20:52 -05:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2013-02-12 13:17:49 -05:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-08-25 03:26:58 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-10-31 19:12:11 +00:00
2016-10-15 17:58:14 +00:00
2017-10-29 20:21:49 +00:00
2017-02-01 22:52:32 +00:00
2017-10-29 19:36:44 +00:00
2016-10-25 22:28:40 +00:00
2017-01-09 21:01:29 +00:00
2016-09-13 20:06:13 +00:00
2017-09-26 04:08:38 +00:00
2017-09-26 04:08:38 +00:00
2017-04-07 15:40:25 +00:00
2017-09-12 05:50:54 +00:00
2017-07-26 23:37:25 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-04-24 12:37:49 +00:00
2016-05-02 13:43:18 +00:00
2016-03-11 21:19:20 +00:00
2016-03-11 21:19:20 +00:00
2016-03-11 21:19:20 +00:00
2016-03-11 22:07:02 +00:00
2017-08-22 13:44:35 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-02-11 21:46:21 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-10-31 13:21:05 +00:00
2016-05-02 13:43:18 +00:00
2017-03-01 01:06:32 +00:00
2017-04-24 12:37:49 +00:00
2016-05-02 13:43:18 +00:00
2014-01-29 09:28:23 +01:00
2015-05-21 17:32:17 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2016-10-27 20:22:49 +00:00
2016-03-30 22:27:13 +00:00
2013-12-12 17:17:02 -08:00
2016-05-02 13:43:18 +00:00
2016-08-19 01:10:21 +00:00
2013-03-15 00:35:09 -04:00
2017-05-19 18:11:51 +00:00
2017-02-02 17:36:43 +00:00
2017-05-19 18:11:51 +00:00
2013-03-15 00:35:09 -04:00
2015-11-03 18:57:18 +00:00
2014-07-01 09:20:51 +02:00
2014-01-03 21:03:20 +01:00
2015-09-06 23:50:51 +00:00
2017-02-10 01:22:30 +00:00
2017-03-25 22:52:54 +00:00
2016-10-31 19:38:50 +00:00
2016-07-06 20:48:41 +00:00
2016-05-02 13:43:18 +00:00
2016-05-02 13:43:18 +00:00
2017-05-11 18:28:40 +00:00
2016-12-23 17:35:24 +00:00