Project

General

Profile

Mejora #752

Implement evaluation cache

Added by Federico Vera about 1 year ago. Updated about 1 year ago.

Status:
Resuelto
Priority:
Wishlist
Assignee:
Target version:
Start date:
2018-07-10
Due date:
2018-08-01
% Done:

100%

Estimated time:
Dificultad:

Description

As of now, every call to Expression#evaluate() reevaluates the whole expression.
This isn't a problem in and of itself, but it's a common error when using the library and creates an annoying performance hit.

  • Find all scenarios where this could fail
  • If an expression contains non-deterministic results, the value should not be cached
  • Cache should be cleaned if variable changes
  • What happens when using setVariables() with maps?
  • Create tests for expression evaluate

PS: We attempted to fix this with documentation and warnings... but still creates a problem. An internal (at least partial) solution shouldn't be hard to accomplish... I think...

Associated revisions

Revision 8b3ab8c3 (diff)
Added by Federico Vera about 1 year ago

Reduce indentation level

Revision 2ff19898 (diff)
Added by Federico Vera about 1 year ago

Fix async test

Revision 40c4cf43 (diff)
Added by Federico Vera about 1 year ago

Implement evaluation cache

Revision 165c914a (diff)
Added by Federico Vera about 1 year ago

Clean unused call in SimplifierTest

Revision 8762cb9d (diff)
Added by Federico Vera about 1 year ago

Remove unused constructor

Revision 09d138d5 (diff)
Added by Federico Vera about 1 year ago

Change attribute visibility

Revision c9958ad3 (diff)
Added by Federico Vera about 1 year ago

Improve cacheResult detection

There are no Non-Deterministic built-in functions.

Revision 6693d372 (diff)
Added by Federico Vera about 1 year ago

Add a debugging method

Revision 83d3fcb5 (diff)
Added by Federico Vera about 1 year ago

Make Expression final

Revision 106d9358 (diff)
Added by Federico Vera about 1 year ago

Add some extra tests

Revision 5f94216d (diff)
Added by Federico Vera about 1 year ago

Use explicit visibility

Revision 5f220f24
Added by Federico Vera about 1 year ago

Merge branch 'implement-evaluation-cache' into 'master'

Implement evaluation cache

See merge request riddler_arg/exp4j!26

History

#1

Updated by Federico Vera about 1 year ago

  • Tracker changed from Desarrollo to Mejora
  • Priority changed from Normal to Wishlist
#2

Updated by Federico Vera about 1 year ago

  • Target version changed from 0.7 to 1.0
#3

Updated by Federico Vera about 1 year ago

  • Description updated (diff)

Scenarios to fail:

  • Multiple async calls (will fail anyway)
  • Non deterministic functions
#4

Updated by Federico Vera about 1 year ago

  • % Done changed from 0 to 70
#5

Updated by Federico Vera about 1 year ago

  • Status changed from Nuevo to Resuelto
  • % Done changed from 70 to 100

Also available in: Atom PDF

Go to top