Hello,
I'd like to thank all for their comments & help. I have finished simple
tests on my (very slow) home P2P.
BE MDB was A97 MDB.
1) In my case, persistent connection ALWAYS slows down performance. Could it
be due to Czech version af Access? Therefore I will not apply persistent
connection in any of my A97 projects.
2) Registry settings (
http://support.microsoft.com/kb/150384/) significantly
speed up performance if BE MDB is already open.
3) In the whole, David Fenton's method (global db variable) seems to work as
expected but, in my case, it slows down performance as well. I'd recommend
some tests on Jet 4 and non-P2P network.
Vlado
=============================================
Important increase of performance are marked with an asterisk (*).
P2P:
- notebook Acer TravelMate 223X
- Windows XP Professional CZ SP2
- 256 MB RAM
- 10MBit LAN card
- MS Office 97 Professional CZ SP2
- desktop PC (noname):
- Windows XP Professional CZ SP2
- P4, 786 MB RAM
- 100MBit LAN card
- MS Office 2002 Professional CZ SP2
———————————————————————————————————————————————
- notebook Acer TravelMate 223X
- main database: KES_data.mdb
- table Karta: 36 records
c:\Dokumenty\_Moje
projekty\Kes\Databaze2002\97\CvicnaDatabazeZS\KES_data.mdb
on desktop mapped as Z:\Databaze2002\97\CvicnaDatabazeZS\KES_data.mdb
———————————————————————————————————————————————
desktop:
db1.mdb with connection to KES_data.mdb on notebook
without persistent connection:
desktop tests, see Public Function test:
9,203125 seconds
9,203125 seconds
9,203125 seconds
persistent connection created on notebook:
db1.mdb with connection to KES_data.mdb (db1 open in Access 97):
desktop tests, see Public Function test:
- open table VZDY (1 record):
40,21875 seconds
40,14063 seconds
40,48438 seconds
- open table VZDYtmp (0 records):
40,32813 seconds
40,20313 seconds
40,23438 seconds
persistent connection created on notebook:
db variable (no table open), see modPersistent.fncPersistentOpen
40,21875 seconds
40,14063 seconds
40,25 seconds
—————————————————————————————————————————
desktop:
desktop project KES.mdb (A97 project converted to A2002): 44.3MB
connected to Z:\Databaze2002\97\CvicnaDatabazeZS\KES_data.mdb
desktop project startup
without persistent connection:
35,7 seconds
35,8 seconds
34,7 seconds
desktop project startup
connected to Z:\Databaze2002\97\CvicnaDatabazeZS\KES_data.mdb
persistent connection created on notebook:
db variable, see modPersistent.fncPersistentOpen
2 minutes 34,7 seconds
2 minutes 33,0 seconds
2 minutes 32,4 seconds
—————————————————————————————————————————
notebook, from db1.mdb, no persistent connection:
0,151001 seconds
0,1500244 seconds
0,1500244 seconds
—————————————————————————————————————————
—————————————————————————————————————————
—————————————————————————————————————————
After changes in notebook's registry.
See
http://support.microsoft.com/kb/150384/
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\LanmanServer\Parameters
Value Name: SharingViolationDelay
Data Type: REG_DWORD
Data: 0 (Default: 200)
Value Name: SharingViolationRetries
Data Type: REG_DWORD
Data: 0 (Default: 5)
.....................................................................................
desktop:
db1.mdb with connection to KES_data.mdb on notebook
without persistent connection:
desktop tests, see Public Function test:
9,84375 seconds
9,90625 seconds
9,78125 seconds
persistent connection created on notebook:
db1.mdb with connection to KES_data.mdb (db1 open in Access 97):
desktop tests, see Public Function test:
- open table VZDY (1 record):
21,04736 seconds *
21,09424 seconds *
21,18701 seconds *
- open table VZDYtmp (0 records):
21,26514 seconds *
21,20264 seconds *
21,39063 seconds *
persistent connection created on notebook:
db variable (no table open), see modPersistent.fncPersistentOpen
21,25 seconds *
21,14063 seconds *
21,0 seconds *
—————————————————————————————————————————
desktop:
desktop project KES.mdb (A97 project converted to A2002): 44.3MB
connected to Z:\Databaze2002\97\CvicnaDatabazeZS\KES_data.mdb
desktop project startup
without persistent connection:
34,6 seconds
35,2 seconds
35,7 seconds
desktop project startup
connected to Z:\Databaze2002\97\CvicnaDatabazeZS\KES_data.mdb
persistent connection created on notebook:
db variable, see modPersistent.fncPersistentOpen
1 minute 11,1 seconds *
1 minute 12,7 seconds *
1 minute 10,1 seconds *
—————————————————————————————————————————
notebook, from db1.mdb, no persistent connection:
0,1508789 seconds
0,1401367 seconds
0,1503906 seconds
—————————————————————————————————————————
—————————————————————————————————————————
—————————————————————————————————————————
Note:
All timings apply to "cached" data (ie. 2nd, 3rd, 4th, ..., data access).
—————————————————————————————————————————
Public Function test()
Dim PauseTime, Start, Finish, TotalTime, i, s
Start = Timer
For i = 1 To 10
Debug.Print DCount("*", "Karta")
DoEvents
Next i
Finish = Timer
TotalTime = Finish - Start
s = TotalTime & " seconds"
Debug.Print s
MsgBox "Total time: " & s
End Function
—————————————————————————————————————————
modPersistent
Option Compare Database
Option Explicit
Public db As Database
Public Function fncPersistentOpen()
Set db = DBEngine.OpenDatabase("c:\Dokumenty\_Moje
projekty\Kes\Databaze2002\97\CvicnaDatabazeZS\KES_data.mdb")
End Function
Public Function fncPersistentClose()
db.Close
Set db = Nothing
End Function