Wrox Programmer Forums
|
ASP.NET 1.1 As of 10/6/2005, this forum is locked as part of the reorganization described here: http://p2p.wrox.com/topic.asp?TOPIC_ID=35394. No posts have been deleted. Open ongoing discussions from the last week have been moved to either ASP.NET 1.0 and 1.1 Beginners http://p2p.wrox.com/asp-net-1-0-1-1-basics-60/ or ASP.NET 1.0 and 1.1 Professional. http://p2p.wrox.com/forum.asp?FORUM_ID=50. See my sticky post inside for more.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.1 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 21st, 2004, 06:16 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default Registry Access

Hello,

I was just curious if there was any performance issues associated with accessing the registry in ASP.NET applications. I plan on storing information in it and would like to hit against it several times in the application lifecycle.

Thanks,

Brian
__________________
Brian
 
Old April 21st, 2004, 08:49 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

In doing some performance testing I found that repeated registry hits were resulting in a measurable slow down. Although it was a pretty small part of the overall execution time, it was quantifiable. One thing I did to resolve it (give that reg information doesn't change much, at least for us) was to pull the keys into a hash table that is a static member of a class. This way, the first time the key value is requested, it's pulled from the registry, but subsequent hits to the same key name are pulled from the static hash table. In addition, this hash table is put in the cache and given a timed expiration. This allows for caching of the keys for the lifecycle of the application.

Page 1
  Reg read 1
    Reg key value read from registry
    Key/value put in class scope hash table
    Hash table put it cache
  Reg read 2
    Reg key value read from class scope hash table

Page 2
  Reg read 1
    Key hash table read from cache
    Reg key value read from class scope hash table
  Reg read 2
    Reg key value read from class scope hash table

Peter
-------------------------
Work smarter, not harder
 
Old April 22nd, 2004, 12:46 AM
Authorized User
 
Join Date: Apr 2004
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to ³Â×÷
Default

Quote:
quote:Originally posted by planoie
 In doing some performance testing I found that repeated registry hits were resulting in a measurable slow down. Although it was a pretty small part of the overall execution time, it was quantifiable. One thing I did to resolve it (give that reg information doesn't change much, at least for us) was to pull the keys into a hash table that is a static member of a class. This way, the first time the key value is requested, it's pulled from the registry, but subsequent hits to the same key name are pulled from the static hash table. In addition, this hash table is put in the cache and given a timed expiration. This allows for caching of the keys for the lifecycle of the application.

Page 1
Reg read 1
    Reg key value read from registry
    Key/value put in class scope hash table
    Hash table put it cache
Reg read 2
    Reg key value read from class scope hash table

Page 2
Reg read 1
    Key hash table read from cache
    Reg key value read from class scope hash table
Reg read 2
    Reg key value read from class scope hash table

Peter
-------------------------
Work smarter, not harder

Please can someone translate this it into plain chinese for me?

 
Old April 22nd, 2004, 09:11 AM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

ÔÚ×öһЩÐÔÄÜÊÔÑéÎÒ·¢ÏÖÖØ¸ ²µÄµÇ¼ÇÃüÖÐÊÇÔì³É¿É²âÁ¿µÄ ¼õËÙ¡£ËäÈ»ÕâÊÇÕûÌåÖ´ÐÐʱ¼ äµÄÒ»Ï൱С²¿·Ý£¬ËüÊǿɼÆ Á¿µÄ¡£ÎÒ×ö½â¾öËüµÄÒ»¼þÊÂ(à ŠÃšÃ“Ã¨reg ÐÅÏ¢²»¸Ä±äÐí¶à£¬ÖÁÉÙΪÎÒà Ç) ½«À­³¶Ô¿³×Èëhash-table ÊÇÀàµÄÒ»Ãû¾²Ì¬³ÉÔ±¡£ÕâÑù£ ¬µÚÒ»´Î¹Ø¼ü¼ÛÖµÇëÇó£¬Ëü±» À­³¶´ÓµÇ¼Ç£¬µ«ËæºóÃüÖжÔÍ ¬Ñù¹Ø¼üÂëÃû×Ö±»À­³¶´Ó¾²Ì¬ hash-table ¡£ÁíÍ⣬Õâhash-table ±»Í¶ÈëÔÚÖü²ØËùºÍ±»¸ø¼ÆÊ±µ ÄʧЧ¡£Õ⿼Âǵ½Öü²ØÔ¿³×Ϊ Ó¦ÓõÄÉúÃüÖÜÆÚ¡£

±Ê¼Ç´ÓÎÒ: ÄúÄÜ·­Òë×Ô¼ºÔÚdictionary.reference.c om/translate/text.html

Snib

<><
 
Old April 23rd, 2004, 03:13 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Thanks Peter. I'm debating on setting this up in my ASP.NET page in the Session_Start method or Application_Start method. Any thoughts about this, whether this is a good/bad approach?

Thanks for your help,

Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
access and update the registry through asp Hughesie78 Classic ASP Professional 12 May 16th, 2008 06:19 AM
remote registry access alex_smotritsky General .NET 2 November 28th, 2007 02:53 AM
COM Interop Access to the registry key denied dshamim ASP.NET 2.0 Professional 1 March 21st, 2007 02:00 AM
Requested registry access is not allowed hasanali00 BOOK: ASP.NET Website Programming Problem-Design-Solution 2 October 7th, 2005 08:53 AM
Chapter 14 - registry access security geoffers BOOK: Beginning VB.NET Databases 2 August 24th, 2005 04:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.