fgl unit, TFPSList needs DeleteRange

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

fgl unit, TFPSList needs DeleteRange

AlexeyT
Hello

I have 1M lines file. CudaText (Lazarus app) cannot delete lines fast
[selected 800K lines]. Reason: TFPSList has only Delete for one item.

Need DeleteRange for many items.

--
Regards,
Alexey

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: fgl unit, TFPSList needs DeleteRange

Michael Van Canneyt


On Sun, 10 Dec 2017, AlexeyT wrote:

> Hello
>
> I have 1M lines file. CudaText (Lazarus app) cannot delete lines fast
> [selected 800K lines]. Reason: TFPSList has only Delete for one item.
>
> Need DeleteRange for many items.


I'm not sure that it will help you: for many cases the list will need to
delete the elements one by one anyway, for instance for interfaces.
Or when a notification of an operation is requested.

But we can consider it, so please post a feature request in the bugtracker.

Michael.
_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: fgl unit, TFPSList needs DeleteRange

Benito van der Zander
Hi Michael Van,

delete the elements one by one anyway, for instance for interfaces.


that can still be speed up by range deletion.  First call _Release on them all, then remove them with move/fillchar.



Bye,
Benito 



_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: fgl unit, TFPSList needs DeleteRange

AlexeyT
Pls, call Deref for all items (1 by 1), by REALLOC all items [e.g. 800K]
as block. Today I call Delete 800K times and do realloc 800K times :(

--
Regards,
Alexey

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal