CudaText: ed.set_text_line is of time complexity O(n)
i’m trying to improve ExTerminal performance. noticed how adding more lines to memo is slowing it down.
as far as i know, adding lines to the end of memo (or adding elements to end of an array) must be fast, i.e. complexity O(1).
to prove it i wrote a simple plugin cuda_complexity_plot
@Alexey-T, you can install it and run command: Complexity Plot: Test 8 ...
and i found the line that is slowing down this API:
with this line it’s O(n) and graph looks like this:
without - it’s O(1) and graph looks like this:
About this issue
- Original URL
- State: closed
- Created 5 months ago
- Comments: 26 (26 by maintainers)
Commits related to this issue
- fixing https://github.com/Alexey-T/CudaText/issues/5360 — committed to Alexey-T/ATSynEdit by Alexey-T 5 months ago
- fixing regress in Redo; for https://github.com/Alexey-T/CudaText/issues/5360 — committed to Alexey-T/ATSynEdit by Alexey-T 5 months ago
just fixed. stupid regress w/o enough testing. sorry.
Fix made
now let’s test usual work for possible regressions.