News for hackers. Stuff that matters.
Re:NotepadNext: A cross-platform reimplementation of Notepad++ by TonyTrapp on Friday April 08, 2022 @04:59PM (#30962430)
If it uses QString as backing storage, that would be UTF-16 internally and would explain the doubling in size.
Re:NotepadNext: A cross-platform reimplementation of Notepad++ by danhau on Saturday April 09, 2022 @04:01AM (#30966078)
I would be surprised if they use straight QStrings. Text editors typically use more sophisticated data structures for their text buffers - Ropes, Piece Tables, Gap Buffers, etc. - tuned for efficient text operations. Maybe their implementation has memory overhead? Wouldn't Notepad++ use UTF-16 internally too, with its Windows heritage?
Re:NotepadNext: A cross-platform reimplementation of Notepad++ by TonyTrapp on Saturday April 09, 2022 @04:59AM (#30966360)
> I would be surprised if they use straight QStrings. Text editors typically use more sophisticated data structures for their text buffers - Ropes, Piece Tables, Gap Buffers, etc. - tuned for efficient text operations.

Sure, I didn't mean to imply that the whole document would be one giant QString. But those data structures might still use a QString as backing memory in the new implementation. I tried to have a look around, but didn't have too much time on hand to dive deep. I could see some QString usage but couldn't confirm if the document itself uses it for storage.

> Wouldn't Notepad++ use UTF-16 internally too, with its Windows heritage

Not necessarily, as the memory consumption of 586MB for a 500MB file shows.

Re:NotepadNext: A cross-platform reimplementation of Notepad++ by arka2147483647 on Saturday April 09, 2022 @05:40AM (#30966530)
I would suspect that it supports multiple encodings, and handle each of them natively
Re:NotepadNext: A cross-platform reimplementation of Notepad++ by jraph on Saturday April 09, 2022 @10:36AM (#30968390)
It could also handle one encoding internally and do the conversion when opening and saving the file.