Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unroll the transaction loop #903

Closed
nkrkv opened this issue Nov 24, 2017 · 0 comments
Closed

Unroll the transaction loop #903

nkrkv opened this issue Nov 24, 2017 · 0 comments
Assignees

Comments

@nkrkv
Copy link
Member

nkrkv commented Nov 24, 2017

Rationale

Discussed on the forum. Quintessence is when we store the program graph in various global structures with tricky access functions we give a little chance for a C++ compiler to optimize.

If the desired sequence of evaluation would be presented as the code we should get a considerable efficiency boost both in terms of execution speed and RAM consumption.

Acceptance criteria

Here is a patch:

map-range-chain

maps are from [0, 1] to [0, 1.1]. Compiled for Arduino UNO it gives:

Sketch uses 4244 bytes (13%) of program storage space. Maximum is 32256 bytes.
Global variables use 1030 bytes (50%) of dynamic memory, leaving 1018 bytes for local variables. Maximum is 2048 bytes.

After the loop unroll we should get less dynamic memory usage.

If we’d uncomment:

// Uncomment to turn on debug of the program
#define XOD_DEBUG

// Uncomment to trace the program runtime in the Serial Monitor
#define XOD_DEBUG_ENABLE_TRACE

We can see 34 transactions are done per second. That characteristic should be not worse after the optimization.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant