|
From: charlie z. <zh....@gm...> - 2009-03-30 14:42:49
|
Hello,
I am trying the code of MyChem that is based on OpenBabel. There's a
substructure match function, some declarations like
OBMol mol;
OBConversion conv;
OBSmartsPattern sp;
conv.SetInFormat("SMI");
and there are 3 lines of code following divided to 2 parts by me. I
run each part 1000 times as
code part 1 consumes 10 seconds on my laptop with Windows XP
conv.ReadString(&mol, smiles_string);
code part 2 consumes 1 second
sp.Init(smarts_pattern);
molecule_match = sp.Match(mol, 1);
BUT, when I put them together and run it for 1000 times, it lasts at
least 100 seconds
for (int i=0;i<1000;i++){
conv.ReadString(&mol, smiles_string);
sp.Init(smarts_pattern);
molecule_match = sp.Match(mol, 1);
}
How to explain this? Thanks.
Regards,
Charlie
zh....@gm...
|