mozilla / spiderflunky

Static analysis of JavaScript
6 stars 3 forks source link

Feed the parser the JS via stdin #6

Open erikrose opened 10 years ago

erikrose commented 10 years ago

…rather than writing it to a file. This yields a 2x speed boost. Quoth Basta:

Previously, we were writing the scripts to a file and then reading them back inside SM, but this passes it all via stdin. This change alone made the validator's unit tests run in about half the time, and running the tests with --processes=4 runs eight times faster.

https://github.com/mozilla/app-validator/blob/master/appvalidator/testcases/javascript/spidermonkey.py#L69 is one operative bit.

mvcisback commented 10 years ago

So I looked at that. Its how I first tried it. The only one issue is that readline only reads 1 line...so you need to put the program on 1 line. This loses any line information about w.r.t. the source doesn't it?

mvcisback commented 10 years ago

ah, they dump to json first...I guess that by passes the issue then