Skip to content

Dev Notes: 2017_01_27

Dave Hudson edited this page Jan 28, 2017 · 7 revisions

More Performance Work

Improving the performance of the code clearly means reducing some of the memory management overheads.

The use of std::vector has been a great way to start things, and it's always a good idea to avoid explicit uses of new and delete, but in this case any small overheads are a problem. In addition, being able to use a customized approach will allow alternative approaches that will significantly optimize things for smaller numbers. Using an array-based approach also means being able to directly access result digit arrays.

All of the current operations are 3-operand forms: A = B op C, in which B and C are constant, but this means that we have to allocate a new object, A, for the result. We have 2-operand forms, A op= B, but they're expressed in terms of the 3-operand variants. Defining explicit versions allows us to avoid this extra overhead.

See Also

Dev Notes: 2017_01_26

Clone this wiki locally