Class ParallelParsingTest

java.lang.Object
com.singularsys.jeptests.unit.misc.parallelparsing.ParallelParsingTest

public class ParallelParsingTest extends Object
A set of tests checking different methods of parallel parsing from the com.singularsys.jep.misc.parallelparsing package.

Some failing tests exhibit problems with certain configurations, like using the standard VariableTable in parallel contexts, this are marked with the @DisabledIfEnvironmentVariable annotation.

Most test show the effect of different configurations on parsing the same set of equations. Name of tests are based on the configuration:

Parsing speeds
Test50100200Comment
Number of equations26001020040400
Serial methods
test_VT_single_SCP_serial_parse()48ms145ms328msStandard Variable Table with a new Standard Configurable Parser per thread
test_VT_PCP_serial_parse()42ms110ms339msStandard Variable Table with a Parallel Configurable Parser
test_CVT_PCP_serial_parse()41ms156ms343msConcurrent Variable Table with a Parallel Configurable Parser
test_VT_single_SP_serial_parse()63ms275ms568msStandard Variable Table with single Standard Parser for all threads
test_CVT_single_SP_serial_parse()72ms226ms666msConcurrent Variable Table with a new Standard Parser per thread
Parallel methods
test_CVT_new_CP_parallel_parse()51ms85ms261msConcurrent Variable Table with a new Configurable Parser per thread
test_CVT_PCP_parallel_parse()66ms148ms370msConcurrent Variable Table with a new Parallel Configurable Parser
test_CVT_new_SCP_parallel_parse()128ms331ms667msConcurrent Variable Table with a new Standard Configurable Parser per thread
test_CVT_new_SP_parallel_parse()96ms196ms717msConcurrent Variable Table with a new Standard Parser per thread
Failing methods
test_VT_new_SCP_parallel_parse()76msFAILEDFAILEDStandard Variable Table with a new Standard Configurable Parser per thread
test_VT_PCP_parallel_parse()FAILEDFAILEDFAILEDStandard Variable Table with a Parallel Configurable Parser
test_CVT_single_SCP_parallel_parse()FAILEDFAILEDFAILEDConcurrent Variable Table with a single Standard Configurable Parser for all threads
test_CVT_single_SP_parallel_parse()FAILEDFAILEDFAILEDConcurrent Variable Table with a single Standard Parser for all threads

The tests results indicate:

  • There is only a marginal gain by parsing in parallel, which only comes into effect when parsing very large numbers of equations.
  • To allow parallel parsing the Concurrent Variable Table must be used. The most efficient is using the ConfigurableParser(Jep, ConfigurableParser) constructor that reuses the set of matchers, then the ParallelConfigurableParser which also reuses the set of matchers. Creating a new StandardConfigurableParser for each thread is slower, and creating a new StandardParser slower still.
  • You cannot reuse the same StandardParser or StandardConfigurableParser between threads.
  • In a single threaded context, its marginally faster to use the standard variable table. These tests indicate the StandardConfigurableParser is faster than the StandardParser, but tests from ParseSpeed indicate the reverse.