Data structure for maintaining tabular data in memory?

前端 未结 6 1997
孤城傲影
孤城傲影 2020-12-04 05:41

My scenario is as follows: I have a table of data (handful of fields, less than a hundred rows) that I use extensively in my program. I also need this data to be persistent,

6条回答
  •  南方客
    南方客 (楼主)
    2020-12-04 06:32

    First, given that you have a complex data retrieval scenario, are you sure even SQLite is overkill?

    You'll end up having an ad hoc, informally-specified, bug-ridden, slow implementation of half of SQLite, paraphrasing Greenspun's Tenth Rule.

    That said, you are very right in saying that choosing a single data structure will impact one or more of searching, sorting or counting, so if performance is paramount and your data is constant, you could consider having more than one structure for different purposes.

    Above all, measure what operations will be more common and decide which structure will end up costing less.

提交回复
热议问题