log(n) amortized growth for containers

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Sun Dec 13 16:21:06 PST 2015


On 12/13/15 2:56 PM, Jimmy Cao wrote:
> On Friday, 11 December 2015 at 03:55:27 UTC, Andrei Alexandrescu wrote:
>> Does anyone know of a plotter that supports logarithmic integral? Of
>> course better ideas about all of the above are welcome!
>>
>
> Yes, my go-to for my university plotting needs is SageMath.
>
> Here is the plot of the two functions, the red one is without the
> li(x).  The vertical axis scale is logarithmic.
>
> https://sagecell.sagemath.org/?z=eJyVjk0KgzAQhfeCdxjcmNAI1mXBK_QIlWAmaWhMZEzB9vRNBDdFCt3NPL73o1CDZiu_QFkAEMYneVgFdLcrc8EM1kc0JF1CODQHcnPmvCzKQqUgk4O-c9bNtoGZm6GHZZQxIg2zC5FNcmZaAElvkHXi3LacC9ByxDG4QH3lrLlHQ4i-EoDK7PouTZIeSIt9Y9-1-9vXSy1ykcN04mTT6lfNc__pYID5NYBQ_V_zAe2Da2c=&lang=sage

Thanks, great!

Now, this is going to be difficult to evaluate in the real world. 
Microbenchmarks are unlikely to be useful - most just grow a vector up 
to wazoo, which works faster with a more aggressive growth schedule. A 
better test is in a real application where several arrays compete for 
data cache.


Andrei



More information about the Digitalmars-d mailing list