]> git.proxmox.com Git - mirror_edk2.git/commit
BaseTools: Replace the sqlite database with list
authorBobCF <bob.c.feng@intel.com>
Fri, 9 Nov 2018 07:41:02 +0000 (15:41 +0800)
committerBobCF <bob.c.feng@intel.com>
Fri, 7 Dec 2018 02:23:07 +0000 (10:23 +0800)
commit2f818ed0fb57d98985d151781a2ce9b8683129ee
treef0d8febdd770253e96aa59cb6032a4ef9364d5c1
parentb3497bad1221704a5dbc5da0b10f42625f1ad2ed
BaseTools: Replace the sqlite database with list

https://bugzilla.tianocore.org/show_bug.cgi?id=1288

[V2]
Optimize this patch so that it can be easy to review.
This patch is just apply the change to original files while
not create new similar files.

[V1]
This patch is one of build tool performance improvement
series patches.

This patch is going to use python list to store the parser data
instead of using sqlite database.

The replacement solution is as below:

SQL insert: list.append()
SQL select: list comprehension. for example:
Select * from table where field = “something”
->
[ item for item in table if item[3] == “something”]

SQL update: python map function. for example:
Update table set field1=newvalue where filed2 = “something”.
-> map(lambda x: x[1] = newvalue,
   [item for item in table if item[2] == “something”])

SQL delete: list comprehension.

With this change, We can save the time of interpreting SQL statement
and the time of write database to file system

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: BobCF <bob.c.feng@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
BaseTools/Source/Python/GenFds/GenFds.py
BaseTools/Source/Python/Workspace/MetaDataTable.py
BaseTools/Source/Python/Workspace/MetaFileParser.py
BaseTools/Source/Python/Workspace/MetaFileTable.py
BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
BaseTools/Source/Python/build/build.py