Nim/lib
Charles Blake 42f8f1cd1f Fix unnecessarily slow set building from openArray.
The estimation of the initialSize as simply array len + 10 was too small for
for all but the smallest sets.  It would not elide/skip one final enlarge().
That last one is actually always the most expensive enlarge().  Indeed, in a
series where one to start from tiny and build up the table..that last one is
about 50% of all the enlarging time in general.  So, this simple and reasonable
optimization (compared to just starting at 64) was only helping about half as
much as it could.

Introduce a rightSize() proc to be the inverse to mustRehash().  Export it
to clients since pre-sizing is externally useful in set construction and the
current mustRehash rules are opaque and beyond the control of clients.

Also add test module logic to check that rightSize() and mustRehash() are
inverses in the appropriate sense..not really in a block/assertion throwing
unit test since this is a peformance nice-to-have issue rather than about
basic correctness.  (Also, fix a too vs. two typo in doc comment.)
2015-02-07 09:37:17 -05:00
..
core Update macros.nim 2015-02-02 17:57:31 +00:00
impure slightly better docs for re module 2015-02-01 11:58:40 +01:00
js docgen should work again 2014-10-05 03:06:19 +02:00
packages/docutils Replace other common expressions with defined variable 2015-01-12 11:20:26 -08:00
posix Fixes parallel build on FreeBSD 2015-01-26 00:06:43 +01:00
pure Fix unnecessarily slow set building from openArray. 2015-02-07 09:37:17 -05:00
system lots of C++ codegen improvements 2015-02-07 10:48:07 +01:00
windows Fix cross to windows compilation on linux 2014-12-30 15:42:18 -05:00
wrappers Support MySQL on OSX 2015-01-11 01:04:20 +01:00
cycle.h Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
nimbase.h Happy new year! 2015-01-06 15:26:33 +01:00
nimrtl.nim Nimrod renamed to Nim 2014-08-28 09:50:51 +02:00
nimrtl.nimrod.cfg Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
prelude.nim Nimrod renamed to Nim 2014-08-28 09:59:26 +02:00
stdlib.nimble VM supports math and a few os procs 2014-08-30 16:37:27 +02:00
system.nim fixes #2011 2015-02-05 12:23:26 +01:00