ColdFusion 9 optimization


coldfusion 9 has giant bottlenecks, made more 100% faster following fixes. in other words, requests, instead of taking 5 seconds, takes 2 seconds.

 

that's kind of improvement coldfusion having real developer around ;-)

 

 

package com.onassignment.optimization;   import java.util.concurrent.concurrentmap; import java.util.concurrent.concurrenthashmap;   import coldfusion.compiler.neotranslator; import coldfusion.vfs.vfsfilefactory;  import coldfusion.runtime.cfjsppage;   import com.onassignment.hibernate.initializer; import com.onassignment.configuration;   public aspect coldfusion {               private static configuration configuration = (configuration)initializer.getapplicationcontext().getbean("configuration");                         /////////// first fix              private static concurrentmap<string,timestamps> pathtotimestamp = new concurrenthashmap<string,timestamps>();           private static long five_second_in_milli = 5000;              pointcut getlastmodifiedtime(string canonicalpagepath):                  execution(public long neotranslator.getlastmodifiedtime(..)) && args( canonicalpagepath );                       long around(string canonicalpagepath): getlastmodifiedtime( canonicalpagepath) {                        long current = system.currenttimemillis();                     timestamps timestamps = pathtotimestamp.get(canonicalpagepath);                        if (           ( timestamps == null ) ||                                          ( !configuration.isenablelastmodifiedtimeoptimization() ) ||                                         ( (timestamps.lastlookup + five_second_in_milli) < current )                                         ){                               long currentfiletime = proceed(canonicalpagepath);                               timestamps = new timestamps(current,currentfiletime);                               pathtotimestamp.put(canonicalpagepath, timestamps);                               return currentfiletime;                      } else {                                return timestamps.filemodifiedtime;                     }               }              //////////// second fix           static concurrentmap<string,boolean> urltoboolean = new concurrenthashmap<string,boolean>();              pointcut checkifvfile(string url):                     execution(public static boolean vfsfilefactory.checkifvfile(..)) && args( url );              boolean around(string url): checkifvfile( url) {                     if (url == null){                               return false;                     }                        boolean isit = urltoboolean.get(url);                     if (isit != null){                               return isit;                     }                        isit = proceed( url );                        urltoboolean.put( url, isit );                        return isit;           }              //////////// third fix           public string cfjsppage.pagepath;              pointcut getpagepath(cfjsppage called):                     execution(public string getpagepath(..)) && target(called);              string around(cfjsppage called): getpagepath( called) {                     if (called.pagepath == null ){                               called.pagepath = proceed(called);                     }                        return called.pagepath;           }    }  

hi,

 

i got here, because have code, of time used functions: getlastmodifiedtime , coldfusion.key.hashcode.

 

the time each equal,

so seems hashcode using getlastmodifiedtime.

 

would code make faster?

can maybe explain why used in hashcode, cant complete function call stack.

 

could send me complete code?



More discussions in ColdFusion


adobe

Comments

Popular posts from this blog

How to change text Component easybook reloaded *newbee* - Joomla! Forum - community, help and support

After Effect warning: A problem occurred when processing OpenGL commands

Preconditions Failed. - Joomla! Forum - community, help and support