Nocode: Please add memoization

Created on 15 Feb 2018  路  3Comments  路  Source: kelseyhightower/nocode

The current implementation of nocode could be executed far more efficiently by adding memoization. Because the entry point is a pure function, it is able to be memoized. This would insure that any subsequent executions of nocode would return


instantly without having to process anything.

My thoughts were something like:

const main = x => {
  const memo = {};
  if (memo.x) {
    return memo.x;
  } else {
    memo.x = ;
    return ;
  }
};

Most helpful comment

@axelsimon Okay, my mistake! I refactored my code. How is this?


All 3 comments

I'm afraid your suggestion doesn't fit with the project's coding standards.

Remember, acceptable forms of code for nocode are

and

Please keep this in mind when suggesting improvements.

@axelsimon Okay, my mistake! I refactored my code. How is this?


:+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexlcdee picture alexlcdee  路  3Comments

Proto-Plastik picture Proto-Plastik  路  3Comments

rdev picture rdev  路  3Comments

metzzo picture metzzo  路  3Comments

rsip22 picture rsip22  路  3Comments