Skip to content

Data structure for holding text data in memory #2

Description

@ev-ev

Currently the main data structure is a linked list with next and prev links with the idea being that the fastest part of the data structure has to be where the user is looking at, so I picked this data structure for the insertion and deletion times. The list doesn't have to be traversed for this since the cursor location is stored.

However, when rendering, the whole list has to be stepped thru anyway, causing noticeable slowdown at ~70k characters. I wonder if a vector data structure would do better, and although insertion times should suffer in theory, deferring the insertion to the WM_PAINT message which requires the whole list to be traversed anyway could maybe allow O(n) speed? (by going backwards thru the list and modifying it along the way for deletions for example).

I'm not too sold on the weird linked lists of char arrays (still feels like they would suffer the same problems, just at a higher character amount). If anyone has insight regarding this I would be extremely thankful :D

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions