Hi all mates,

during the last couple of months the work we've been doing on Feature
files processing is HUGE, so the iterations to refine the pipeline
process introduced some "overhead" operations we can improve, what we
currently do is:

 * the pre processor starts by reading the whole file to memory,
storing it in a String reference;
 * parse the JSON file to create the javax.json DOM and check the `id`
property is missing, adding it if necessary and then serializing it to
string again:
 * JSON Schema validation takes the string as input, creates the
Jackson DOM to validate it against the defined schema;
 * if schema validation is OK, the Substitution takes the JSON string
as input to interpolate variables, which creates a new JSON string
representation;
 * the JS Min takes the JSON string representation and converts it to
a new JSON string representation where useless stuff are removed;
 * at that point, the JSON Feature reader takes the final string and
creates a javax.json DOM once again to map it to a Feature instance.

My proposal is improving a little our pipeline in order to speed up
the JSON processing in that way:

 * the JS Min starts by reading the whole file to memory, storing it
in a String reference;
 * the Substitution takes the JSON string as input to interpolate
variables, which creates a new JSON string representation;
 * a Jackson DOM will be created in order to check the `id` property
is missing, adding it if necessary;
 * the Jackson DOM will be validated against the defined schema;
 * the Jackson DOM will be mapped to a Feature instance.

WDYT?

Many thanks in advance!
~Simo

http://people.apache.org/~simonetripodi/
http://twitter.com/simonetripodi

Reply via email to