Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 -- Generate n-grams of Skia API calls from SKPs. | 1 -- Generate n-grams of Skia API calls from SKPs. |
| 2 | 2 |
| 3 -- To test this locally, run: | 3 -- To test this locally, run: |
| 4 -- $ GYP_DEFINES="skia_shared_lib=1" make lua_pictures | 4 -- $ GYP_DEFINES="skia_shared_lib=1" make lua_pictures |
| 5 -- $ out/Debug/lua_pictures -q -r $SKP_DIR -l tools/lua/ngrams.lua > /tmp/lua-ou tput && lua tools/lua/ngrams_aggregate.lua | 5 -- $ out/Debug/lua_pictures -q -r $SKP_DIR -l tools/lua/ngrams.lua > /tmp/lua-ou tput |
| 6 -- $ lua tools/lua/ngrams_aggregate.lua | |
|
borenet
2015/06/26 19:58:44
Everything after '&&' gets stripped out by the ser
rmistry
2015/06/26 20:16:01
You could try escaping it to make it work. I agree
| |
| 6 | 7 |
| 7 -- To run on Cluster Telemetry, copy and paste the contents of this file into | 8 -- To run on Cluster Telemetry, copy and paste the contents of this file into |
| 8 -- the box at https://skia-tree-status.appspot.com/skia-telemetry/lua_script, | 9 -- the box at https://skia-tree-status.appspot.com/skia-telemetry/lua_script, |
| 9 -- and paste the contents of ngrams_aggregate.lua into the "aggregator script" | 10 -- and paste the contents of ngrams_aggregate.lua into the "aggregator script" |
| 10 -- box on the same page. | 11 -- box on the same page. |
| 11 | 12 |
| 12 -- Change n as desired. | 13 -- Change n as desired. |
| 13 local n = 3 | 14 local n = 3 |
| 14 | 15 |
| 15 -- This algorithm uses a list-of-lists for each SKP. For API call, append a | 16 -- This algorithm uses a list-of-lists for each SKP. For API call, append a |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 counts[ngram] = counts[ngram] + 1 | 54 counts[ngram] = counts[ngram] + 1 |
| 54 end | 55 end |
| 55 end | 56 end |
| 56 end | 57 end |
| 57 | 58 |
| 58 -- Write out code for aggregating. | 59 -- Write out code for aggregating. |
| 59 for ngram, count in pairs(counts) do | 60 for ngram, count in pairs(counts) do |
| 60 io.write("if counts['", ngram, "'] == nil then counts['", ngram, "'] = ", co unt, " else counts['", ngram, "'] = counts['", ngram, "'] + ", count, " end\n") | 61 io.write("if counts['", ngram, "'] == nil then counts['", ngram, "'] = ", co unt, " else counts['", ngram, "'] = counts['", ngram, "'] + ", count, " end\n") |
| 61 end | 62 end |
| 62 end | 63 end |
| OLD | NEW |