summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2015-10-21 10:17:21 +0000
committerPavel Labath <labath@google.com>2015-10-21 10:17:21 +0000
commit65a16e56b976f5e9e10c197df927da358257ab9c (patch)
tree4a4fe4235215039475c3b7830220e63206f39ed9 /lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp
parente8c51fdbd6c74cfa07bc9fae089bc4587cb2226b (diff)
downloadbcm5719-llvm-65a16e56b976f5e9e10c197df927da358257ab9c.tar.gz
bcm5719-llvm-65a16e56b976f5e9e10c197df927da358257ab9c.zip
[DataFormatters] Make libc++ list loop detection linear
Summary: Loop detection code is being called before every element access. Although it tries to cache some of the data by remembering the loop-free initial segment, every time it needs to increase this segment, it will start from scratch. For the typical usage pattern, where one accesses the elements in order, the loop detection will need to be run after every access, resulting in quadratic behavior. This behavior is noticable even for the default 255 element limit. In this commit, I rewrite the algorithm to be truly incremental -- it maintains the state of its loop-detection runners between calls, and reuses them when it needs to check another segment. This way, each part of the list is scanned only once, resulting in linear behavior. Also note that I have changed the operator== of ListEntry to do the comparison based on the value() function (instead of relying on ValueObjectSP equality). In my experiments, I kept getting different ValueObjectSPs when going through the same element twice. Reviewers: granata.enrico Subscribers: lldb-commits, sivachandra Differential Revision: http://reviews.llvm.org/D13902 llvm-svn: 250890
Diffstat (limited to 'lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptRuntime.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud