diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-03-29 10:06:12 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-03-29 10:06:12 +0100 |
commit | c5ec741a258577386f30ad2577141ce498f6310c (patch) | |
tree | 143954985bf223b06bbeb9d8c27d64d18a52c706 /lib/protocol_benchmarks.py | |
parent | 8b6735c64b48153c5bf39536489834174edbd334 (diff) |
argument-aware analysis of protocolmodeling cycles benchmarks
Diffstat (limited to 'lib/protocol_benchmarks.py')
-rwxr-xr-x | lib/protocol_benchmarks.py | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/lib/protocol_benchmarks.py b/lib/protocol_benchmarks.py index 6220b94..b7af4f7 100755 --- a/lib/protocol_benchmarks.py +++ b/lib/protocol_benchmarks.py @@ -1354,25 +1354,28 @@ def shorten_call(snippet, lib = ''): # mpack_start_array(&writer, x) -> mpack_start_array(&writer elif 'mpack_start_' in snippet: snippet = snippet.split(',')[0] - elif 'bout <<' in snippet: - if '\\":\\"' in snippet: - snippet = 'bout << key:str' - elif 'bout << "\\"' in snippet: - snippet = 'bout << key' - else: - snippet = 'bout << other' + #elif 'bout <<' in snippet: + # if '\\":\\"' in snippet: + # snippet = 'bout << key:str' + # elif 'bout << "\\"' in snippet: + # snippet = 'bout << key' + # else: + # snippet = 'bout << other' elif 'msg.' in snippet: snippet = re.sub('msg.(?:[^[]+)(?:\[.*?\])? = .*', 'msg.? = ?', snippet) elif lib == 'arduinojson:': - snippet = re.sub('ArduinoJson::JsonObject& [^ ]+ = [^.]+.createNestedObject\([^)]*\);', 'ArduinoJson::JsonObject& ? = ?.createNestedObject(?);', snippet) - snippet = re.sub('ArduinoJson::JsonArray& [^ ]+ = [^.]+.createNestedArray\([^)]*\);', 'ArduinoJson::JsonArray& ? = ?.createNestedArray(?);', snippet) + snippet = re.sub('ArduinoJson::JsonObject& [^ ]+ = [^.]+.createNestedObject\([^")]*\);', 'ArduinoJson::JsonObject& ? = ?.createNestedObject();', snippet) + snippet = re.sub('ArduinoJson::JsonObject& [^ ]+ = [^.]+.createNestedObject\("[^")]*"\);', 'ArduinoJson::JsonObject& ? = ?.createNestedObject(?);', snippet) + snippet = re.sub('ArduinoJson::JsonArray& [^ ]+ = [^.]+.createNestedArray\([^")]*\);', 'ArduinoJson::JsonArray& ? = ?.createNestedArray();', snippet) + snippet = re.sub('ArduinoJson::JsonArray& [^ ]+ = [^.]+.createNestedArray\("[^")]*"\);', 'ArduinoJson::JsonArray& ? = ?.createNestedArray(?);', snippet) snippet = re.sub('root[^[]*\["[^"]*"\] = [^";]+', 'root?["?"] = ?', snippet) snippet = re.sub('root[^[]*\["[^"]*"\] = "[^"]+"', 'root?["?"] = "?"', snippet) snippet = re.sub('rootl.add\([^)]*\)', 'rootl.add(?)', snippet) snippet = re.sub('^dec_[^ ]*', 'dec_?', snippet) if lib == 'arduinojson:': - snippet = re.sub('root[^. ]+\.as', 'root[?].as', snippet) + snippet = re.sub('root[^[]*\[[^]"]+\]\.as', 'root[?].as', snippet) + snippet = re.sub('root[^[]*\["[^]]+"\]\.as', 'root["?"].as', snippet) elif 'nanopb:' in lib: snippet = re.sub('= msg\.[^;]+;', '= msg.?;', snippet) elif lib == 'mpack:': |