Recent

Author Topic: Map vs dataset  (Read 878 times)

Packs

  • Sr. Member
  • ****
  • Posts: 409
Map vs dataset
« on: December 05, 2024, 07:12:40 pm »
Keeping object inside map and doing find and manipulating vs keeping data inside dataset and doing locate and manipulation.

Which is fast map vs dataset or memdatset or virtualdatset

silvercoder70

  • Full Member
  • ***
  • Posts: 124
    • Tim Coates
Re: Map vs dataset
« Reply #1 on: December 05, 2024, 10:51:10 pm »
My 2c worth ... speed is one thing, and development time is another and other things.

1. If a dataset (broadly speaking) can deliver similar results to using a map, I would likely defer to the dataset. I am guessing that at some point in time, the data in the map would have to get written to disk?

2. How much data is actually involved? And if you were to load from a dataset, how long would it take to load? If small, then I would certainly go down the memory route.

3, If calculation are made as a result of a update (or insert?) then perhaps more of an OO approach is better.

that's off the top of my head, but are the first things I look at before writing any code. Hope that helps.

-- Tim
Explore the beauty of modern Pascal programming with Delphi & Free Pascal - https://www.youtube.com/@silvercoder70

Packs

  • Sr. Member
  • ****
  • Posts: 409
Re: Map vs dataset
« Reply #2 on: December 06, 2024, 07:03:19 am »
Map and dataset both store inside memory

Map is useful for json manipulation.

Dataset I will get filter and locate option.


cdbc

  • Hero Member
  • *****
  • Posts: 1784
    • http://www.cdbc.dk
Re: Map vs dataset
« Reply #3 on: December 06, 2024, 07:46:53 am »
Hi
Hmmm...  Specialize a 'Map' and add 'Filter' & 'Locate' to the specialization...
Oh, and shy away from 'variants', as they're slow.
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE5 -> FPC 3.2.2 -> Lazarus 2.2.6 up until Jan 2024 from then on it's: KDE5/QT5 -> FPC 3.3.1 -> Lazarus 3.0

 

TinyPortal © 2005-2018