speed problem using smart pointers on FPC.Root
来源:互联网 发布:linux运维项目实战 编辑:程序博客网 时间:2024/06/05 16:03
The EggHeadCafe.com web spider found the following conversation that may be helpful to you.
Next Thread: Upgrade ISA 2000 (on SBS 2003) to ISA 2004 I get an Error
8/10/2004 2:30:04 PM speed problem using smart pointers on FPC.Root
8/11/2004 7:15:25 AM RE: speed problem using smart pointers on FPC.Root
8/11/2004 2:18:32 PM Re: speed problem using smart pointers on FPC.Root
8/12/2004 10:24:44 AM Re: speed problem using smart pointers on FPC.Root
8/12/2004 5:33:37 PM Re: speed problem using smart pointers on FPC.Root
8/13/2004 10:30:36 AM Re: speed problem using smart pointers on FPC.Root
8/13/2004 3:07:47 PM Re: speed problem using smart pointers on FPC.Root
8/16/2004 9:54:12 AM Re: speed problem using smart pointers on FPC.Root
8/16/2004 1:32:52 PM Re: speed problem using smart pointers on FPC.Root
8/19/2004 1:16:14 PM Re: speed problem using smart pointers on FPC.Root
8/20/2004 11:15:22 AM Re: speed problem using smart pointers on FPC.Root
8/20/2004 7:35:36 PM Re: speed problem using smart pointers on FPC.Root
8/23/2004 10:02:58 AM Re: speed problem using smart pointers on FPC.Root
Next Thread: Upgrade ISA 2000 (on SBS 2003) to ISA 2004 I get an Error
8/10/2004 2:30:04 PM speed problem using smart pointers on FPC.Root
Hi, I've a little speed problem while browsing destinations sets. It tooks about 8" to browse a full 1024 destinations set. It's not a network problem, because I got also large execution time when running on the ISA server (4" : +-1000 entries/second). It's a problem, because I plane to use destinations sets that contains more than 450 000 entries so it could take more than an hour to export the entiere content. Is there any way to speed up the thing ? When using ISA mmc, it takes not such time to retrieve the destination sets content even from a distant machine. Maybe the smart pointers are not the right way. I connect to the ISA using CoInitializeEx(), using "localhost" as target when running on the ISA. nb: Because of the bug on the long result for fpcDestinationSet->Count discuted a few days ago, I can't know the count for a Set, so, I'm using an infinite loop incrementing the variable "l" until falling in exception catched by the try/catch couple when reaching the end. Thanks for help. ------------------------------------- FpcDestinationAddressType Dtype ; long l = 1; CString Buff; try { while (fpcDestination = fpcDestinationSet->Item (_variant_t(l),(BSTR) NULL ,(BSTR) NULL)){ fpcDestination->get_Type( &Dtype ); Dtype=fpcDestination->Type; switch ( Dtype ){ case 0 : Buff=(char*) fpcDestination->DomainName; break; case 1 : Buff= (char*) fpcDestination->IP_From; break; case 2: break; default : break; } Buff.TrimRight(); Buff.TrimLeft(); //here : storing Buff in a file but commented while testing speed l++; } }catch ( _com_error& pCE ){ }
<script type="text/javascript"><!--google_ad_client = "pub-8682474657542641";google_alternate_ad_url = "http://www.eggheadcafe.com/alternateads.asp";google_ad_width = 300;google_ad_height = 250;google_ad_format = "300x250_as";google_ad_channel ="2428473602";google_color_border = "FFFFFF";google_color_bg = "FFFFFF";google_color_link = "6D99CA";google_color_url = "008000";google_color_text = "000000";//--></script><script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script><iframe name="google_ads_frame" marginwidth="0" marginheight="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-8682474657542641&dt=1111377242406&lmt=1111377242&alternate_ad_url=http%3A%2F%2Fwww.eggheadcafe.com%2Falternateads.asp&format=300x250_as&output=html&channel=2428473602&url=http%3A%2F%2Fwww.eggheadcafe.com%2Fng%2Fmicrosoft.public.isa.sdk-dev%2Fpost2135600.asp&color_bg=FFFFFF&color_text=000000&color_link=6D99CA&color_url=008000&color_border=FFFFFF&ref=http%3A%2F%2Fwww.eggheadcafe.com%2Fng%2Fmicrosoft.public.isa.sdk-dev%2Fasummary_1.asp&u_h=768&u_w=1024&u_ah=738&u_aw=1024&u_cd=32&u_tz=480&u_java=true" frameborder="0" width="300" scrolling="no" height="250" allowtransparency="65535"></iframe>
8/11/2004 7:15:25 AM RE: speed problem using smart pointers on FPC.Root
Hi Alni, I have been looking into this issue and will update you with my result. Please wait for my message. Thanks. Best regards, WenJun Zhang Microsoft Online Support This posting is provided "AS IS" with no warranties, and confers no rights. Get Secure! - www.microsoft.com/security
8/11/2004 2:18:32 PM Re: speed problem using smart pointers on FPC.Root
Bonjour, "WenJun Zhang[msft]" <v-wzhang@online.microsoft.com> a écrit : Yes, of course, I know. Thanks again for that. But at this point, I just wonder if I should consider as "normal", that it takes more than 4" to browse 1000 destinations using my code. May be there is an other way. Because I'm planning to use destinations sets of about half a million destinations. So it could take more than 4*500=2000". More than 1/h hour to retrieve the set to a file !!! Such a file that contains 500 000 entries weigh 8Mo, so the "write to file" time should be negligible. On the other side, using ISA management MMC, it takes about 5" to fill the list box that contains the 500 000 entries set (even on a distant machine). That's why, I wonder.... Regards,
8/12/2004 10:24:44 AM Re: speed problem using smart pointers on FPC.Root
Hi Alni, I also met the C2556 and C2371 errors on GetType(). I wonder how you finally worked around it? error C2556: 'GetType' : overloaded functions only differ by return type error C2371: 'GetType' : redefinition; different basic types At least the low performance shouldn't be caused by FPC. I tested going through 1024 items destination set in vbs. It definitely needn't 1 sec to finish. So I do think the problem is in the VC code. Dim objFPC Dim fpcDestinationSets Dim fpcDestinationSet Dim objFPCArray Dim fpcDestination Dim temp Set objFPC = CreateObject("FPC.Root") Set objFPCArray = objFPC.Arrays(1) Set fpcDestinationSets = objFPCArray.PolicyElements.DestinationSets set fpcDestinationSet= fpcDestinationSets("test") for each fpcDestination in fpcDestinationSet 'Wscript.echo fpcDestination.type Select Case fpcDestination.type Case 0 'Wscript.echo fpcDestination.domainname temp = fpcDestination.domainname Case 1 'Wscript.echo fpcDestination.Ip_From temp = fpcDestination.Ip_From Case 2 End Select 'Wscript.echo next Wscript.echo temp Best regards, WenJun Zhang Microsoft Online Support This posting is provided "AS IS" with no warranties, and confers no rights. Get Secure! - www.microsoft.com/security
8/12/2004 5:33:37 PM Re: speed problem using smart pointers on FPC.Root
Hi, "WenJun Zhang[msft]" <v-wzhang@online.microsoft.com> a écrit : There is an enum "type" for the return value http://msdn.microsoft.com/library/en-us/isa/isaenum_9ecl.asp So : FpcDestinationAddressType Dtype ; long l=1; try { while (fpcDestination = fpcDestinationSet->Item (_variant_t(l),(BSTR) NULL ,(BSTR) NULL)){ Dtype=fpcDestination->Type; // or fpcDestination->get_Type( &Dtype ); switch ( Dtype ){ case 0 : Buff=(char*) fpcDestination->DomainName; break; case 1 : Buff= (char*) fpcDestination->IP_From; break; default : break; } ...../.... l++ } }catch ( _com_error& pCE ){ Display.Format("Failed: %x, source %s/n", pCE.Error, (char*) pCE.Source()); // MessageBox(Display); } Using CoCreateInstanceEx() ? In order to use my prog from a distant machine, I have to use this method. Of course when I use hr = fpcRoot.CreateInstance("FPC.Root") and run the exe on the ISA itself, I've no speed problem at all Looking at the task manager of the ISA while running the 2 methods, I can observe that - CoCreateInstanceEx()uses a dllhost.dll on the ISA that grows up to 300 Mo when using my huge destination set (470000 entries). The process is slow as I said previously, even if I run from the ISA specifying localhost as target. - fpcRoot.CreateInstance("FPC.Root") runs on the ISA itself and is very fast (also less than less than 1" to complete the export 1000 items destination set. In that case, there is no dllhost that appears, but my prg itself grows up to 300Mo when playing with the huge set. But for now, I've removed the huge set, I run my test ISA server in a vmware and my computer is only 512Mo RAM, so this huge set was causing lots of swap on the VM and on my computer :) What's happen if you use : Set objFPC = CreateObject("FPC.Root", "YourISAServer") from your ISA and eventually from a distant machine ? I suppose that vbs translate : CreateObject("FPC.Root") by fpcRoot.CreateInstance("FPC.Root") (whih is fast for me) but I wonder how it will translate : CreateObject("FPC.Root", "YourISAServer") and if it cause speeds problems If I've a little time I will try to use your script using this method. Regards,
8/13/2004 10:30:36 AM Re: speed problem using smart pointers on FPC.Root
Hi Alni, I'm not testing on a distant machine. Locally test the following two lines and their performance appears to be no difference. Set objFPC = CreateObject("FPC.Root") Set objFPC = CreateObject("FPC.Root", "YourISAServer") Have you got a work around of the huge set yet? :-) Best regards, WenJun Zhang Microsoft Online Support This posting is provided "AS IS" with no warranties, and confers no rights. Get Secure! - www.microsoft.com/security
8/13/2004 3:07:47 PM Re: speed problem using smart pointers on FPC.Root
Bonjour, "WenJun Zhang[msft]" <v-wzhang@online.microsoft.com> a écrit : While not fixed, I'm using endless loops between try/catch couples ----------------------------------------- l=1; FpcDestinationAddressType Dtype ; try { while (fpcDestination = fpcDestinationSet->Item (_variant_t(l),(BSTR) NULL ,(BSTR) NULL)){ fpcDestination->get_Type( &Dtype ); Dtype=fpcDestination->Type; switch ( Dtype ){ case 0 : Buff=(char*) fpcDestination->DomainName; break; case 1 : Buff= (char*) fpcDestination->IP_From; break; case 2: break; default : break; } Buff.TrimRight(); Buff.TrimLeft(); Buff+="/n"; File.WriteString(Buff); l++; } }catch ( _com_error& pCE ){ TRACE("Failed: %x, source %s/n", pCE.Error, (char*) pCE.Source()); } When the program reach the end of the set, it falls in the catch.... I've just put a TRACE in order to prevent compilation warning if pCE is not used. Regards
8/16/2004 9:54:12 AM Re: speed problem using smart pointers on FPC.Root
Hi Alni, I'm still not able to get rid of the C2556 and C2371 error. Reduced the code as below and the error still occurs. Could you provide the your modified code with the error worked around? Probabaly I'd file another ISA SE bug about the FpcDestinationAddressType GetType redefinition. I haven't found where can cause the endless loop. Will you still get into the loop with the following reduced code? int main (int argc, WCHAR **argv) { DWORD dwRet = 0; HRESULT hr = CoInitializeEx (NULL, COINIT_APARTMENTTHREADED ); FPCLib::IFPCPtr fpcRoot; FPCLib::IFPCArraysPtr fpcArrays; FPCLib::IFPCArrayPtr fpcArray; FPCLib::IFPCDestinationSetPtr fpcDestinationSet; FPCLib::IFPCDestinationPtr fpcDestination; hr = fpcRoot.CreateInstance("FPC.Root"); if (FAILED (hr)) { printf ("Failed: %x/n", hr); return dwRet; } try { fpcArrays = fpcRoot->Arrays; long v1 = 1; if ( fpcArrays->Item (_variant_t(v1)) == NULL ) return dwRet; fpcArray = fpcArrays->Item (_variant_t(v1)) ; fpcDestinationSet=fpcArray->PolicyElements->DestinationSets->Item(_var iant_t(v1)) ; FPCLib::FpcDestinationAddressType Dtype ; CString Buff; long l = 1; try { while (fpcDestination = fpcDestinationSet->Item (_variant_t(l),(BSTR) NULL ,(BSTR) NULL)){ fpcDestination->get_Type( &Dtype ); Dtype=fpcDestination->Type; switch ( Dtype ){ case 0 : Buff=(char*) fpcDestination->DomainName; printf ("Destination domain name: %s/n", Buff); break; case 1 : Buff= (char*) fpcDestination->IP_From; printf ("Destination IP from: %s/n", Buff); break; case 2: break; default : break; } l++; } } catch ( _com_error& pCE ){ printf ("Failed: %x, source %s/n", pCE.Error, (char*) pCE.Source()); } } catch (_com_error& pCE) { printf ("Failed: %x, source %s/n", pCE.Error, (char*) pCE.Source()); } dwRet = 1; // Ok. CoUninitialize(); return dwRet; } Best regards, WenJun Zhang Microsoft Online Support This posting is provided "AS IS" with no warranties, and confers no rights. Get Secure! - www.microsoft.com/security
8/16/2004 1:32:52 PM Re: speed problem using smart pointers on FPC.Root
Bonjour, "WenJun Zhang[msft]" <v-wzhang@online.microsoft.com> a écrit : I use "using namespace FPCLib;" directive, then I declare : IFPCPtr fpcRoot; IFPCArraysPtr fpcArrays; IFPCArrayPtr fpcArray; IFPCDestinationSetPtr fpcDestinationSet; IFPCDestinationPtr fpcDestination; FpcDestinationAddressType Dtype; That works this way. This is part of my OnExport() function. When the counter "l" reach the end of the set+1, this line fails : while(fpcDestination = fpcDestinationSet->Item()) So the program jumps to the catch line... --------------------------------------------------- l=1; FpcDestinationAddressType Dtype ; try { while (fpcDestination = fpcDestinationSet->Item (_variant_t(l),(BSTR) NULL ,(BSTR) NULL)){ if (l%100==0) { m_Status.Format("Export in progress... Count : %8ld",l); UpdateData(FALSE); UpdateWindow(); } fpcDestination->get_Type( &Dtype ); Dtype=fpcDestination->Type; switch ( Dtype ){ case 0 : Buff=(char*) fpcDestination->DomainName; break; case 1 : Buff= (char*) fpcDestination->IP_From; break; case 2: break; default : break; } Buff.TrimRight(); Buff.TrimLeft(); Buff+="/n"; File.WriteString(Buff); l++; } }catch ( _com_error& pCE ){ TRACE("Failed: %x, source %s/n", pCE.Error, (char*) pCE.Source()); } m_Status="Export completed.";
8/19/2004 1:16:14 PM Re: speed problem using smart pointers on FPC.Root
Hi Alni, I'm still researching this issue and will update you as soon as I get more information on it. Please wait for my message. Thanks. Best regards, WenJun Zhang Microsoft Online Support This posting is provided "AS IS" with no warranties, and confers no rights. Get Secure! - www.microsoft.com/security
8/20/2004 11:15:22 AM Re: speed problem using smart pointers on FPC.Root
Hi Alni, I finally reproduced the problem you met. When the l exceeds the count of the set, the exception is thrown out. fpcDestination = fpcDestinationSet->Item(_variant_t(l) Since currently you cannot use fpcDestinationSet->Count to determine if l has exceeded, I think there isn't a way to prevent it from jumping into the Catch. I'll keep monitoring the previous bug. Current status is it has been assigned to 1 of our test engineers. Please also consider if it's necessary for you to open a case and submit QFE request. Thanks. Best regards, WenJun Zhang Microsoft Online Support This posting is provided "AS IS" with no warranties, and confers no rights. Get Secure! - www.microsoft.com/security
8/20/2004 7:35:36 PM Re: speed problem using smart pointers on FPC.Root
Bonjour, "WenJun Zhang[msft]" <v-wzhang@online.microsoft.com> a écrit : ????? That's what I want : "Jump into the catch" :) I have no problem with this. You ask me : > Have you got a work around of the huge set yet? :-) I've understood, that you want me to show you what workaround I've found while the fpcDestinationSet->Count bug is not fixed. Then, I put an endless loop between a try/catch couple, and when it falls into the catch, I know I'm at the end of the set. It works fine this way, waiting the bug to be fixed.
8/23/2004 10:02:58 AM Re: speed problem using smart pointers on FPC.Root
"It works fine this way, waiting the bug to be fixed." Sure, it has been taken ownership by one of our product test engineer. I'll keep monitoring and when the bug is closed, I'll send a mail to inform you. :-) Thanks. Best regards, WenJun Zhang Microsoft Online Support This posting is provided "AS IS" with no warranties, and confers no rights. Get Secure! - www.microsoft.com/security
- speed problem using smart pointers on FPC.Root
- Using smart pointers for class members
- Using C++ 11's Smart Pointers
- Using smart pointers for class members
- Smart pointers
- Smart Pointers
- Templates and Smart Pointers
- smart pointers 2
- Reference Counted Smart Pointers
- Smart Pointers in Boost
- Smart Pointers智能指针
- Smart Pointers in C++
- 智能指针(Smart Pointers)
- C++11 Smart Pointers
- Demo on bar code printing using SAP Scripts/Smart forms
- Pointers on C——12 Using Structures and Pointers.1
- Pointers on C——12 Using Structures and Pointers.2
- Pointers on C——12 Using Structures and Pointers.3
- [转贴]一个老程序员的心里话
- XML Schema学习(二)
- 登录帐号合法性检测函数
- 我的第一个EVC程序
- 一些开源的JMX工具
- speed problem using smart pointers on FPC.Root
- OSPF路由协议综述及其配置
- 从SUN的website看SUN和M$的竞争
- 在状态栏显示时钟
- 关于Tomcat的并发处理能力
- 2005年3月21日 多云,风大
- boiz 的C++ 备忘录(三)-- 注意strcpy函数的一个陷阱
- 解读ASP.NET 2.0 Internals
- 关于中国特色的一个小笑话,转自孟岩blog的一个回复