![]() |
Fusion Authority The House of Fusion Technical Magazine |
Issue:
5 January 10, 2000 January 16, 2000 |
| This is an opt-in magazine. To join, leave or change subscription mode, please visit the signup page. All content of this magazine is copyright Fusion Authority, Inc. It may not be reproduced without permission. | ||
Developer's Exchange: Fusion Authority Listing
[Top]
MERANT will provide scalable transaction-based connectivity between ColdFusion applications residing on Linux and industry-leading databases, including MySQL, Oracle, Microsoft SQL Server, Informix and Sybase.
Datek News Story (PRNewswire)
Ecommerce Times
[Top]
Prior to joining Allaire, Favaloro served as Director of Marketing for Compaq Corporation, where he founded and launched the company's Internet Solutions Division. Most recently, he was responsible for worldwide marketing of Compaq's enterprise solutions for e-commerce, ISPs/ASPs, Internet security, and Web and application servers working with key partners such as Microsoft, Oracle, and Checkpoint.
Allaire Adds New Vice President Of Business Development To Executive Management Team
Datek News Story
[Top]
Allaire Corporation Takes Half of Riverside Center for New Headquarters (Smartmoney)
[Top]
[Top]
[Top]
http://www.htmlcenter.com/reviews/reviews.cfm/80
[Top]
[Top]
A potential fix for this is to use the following code
|
<CFLOOP COLLECTION=#Session# ITEM="key">
<CFIF Not ListFindNoCase('CFID,CFTOKEN,SESSIONID,URLTOKEN', Key)> <CFSET StructDelete(Session, Key)> </CFIF> </CFLOOP> |
[Top]
For more information, see http://www.allaire.com/developer/gallery/index.cfm?Objectid=14084
[Top]
http://beta.allaire.com/cfarizona
[Top]
http://beta.allaire.com/ejipt20
[Top]
"The Web's a new frontier. Clients are afraid to spend more and more money on their site unless they see an immediate return. Unfortunately, they won't see an immediate return unless they spend more and more money on it!"
[Top]
There are a number of ways to compare two text strings inside a ColdFusion CFIF statement. The problem is, some are faster than others. Now you may think that comparing strings would be the same no matter what method is used. Unfortunately, this is not true. I could dream up a number of reasons for this but it really wouldn't matter. What does matter is results. For this reason, I'll be going over each of the comparison methods, giving you their average speeds and how to use them. If this information is used properly, then you should see a jump of 50% in your CFIF statements and hopefully some more speed in all your code.
Before we start, I'm going to assume you know the ins and outs of a CFIF statement. That being the case, what we're looking at here is either the Statement part of a CFIF or a single Clause of the statement.
|
<CFIF Statement>
<CFIF Clause [joiner] Clause> |
If you have any questions on the structure and proper use of a CFIF, you can check it out in the ColdFusion documentation, in any of the excellent ColdFusion books that have been written or you can wait till I release my paper on The Complete CFIF, which will be a slightly altered version of the Comparison chapter in the forthcoming book, Core ColdFusion.
| Comparison Method | Fastest (ms) | Average (ms) |
|---|---|---|
| Variable IS "Value" | .29 | .30 |
| NOT Compare(Variable, 'Value') | .10 | .11 |
| NOT CompareNoCase(Variable, 'Value') | .11 | .11 |
| Find(Variable, 'Value') | .10 | .11 |
| FindNoCase(Variable, 'Value') | .10 | .11 |
| REFind('Value', Variable) | .14 | .14 |
| REFindNoCase('Variable', Value) | .16 | .17 |
|
<CFIF Variable IS "Value">
|
While this statement works and works well, it's actually the slowest way to compare text values. I believe that this statement does a few evaluations before trying to do any sort of comparison. The first evaluation is to see if either value is a Boolean and the second is to see if either is a Numeric. If they are one of these data types, then the actual comparison goes rather fast. (This is because of the way ColdFusion processes Boolean and numbers vs. text values.) If not, then a standard text comparison is performed. I've come to this conclusion after a few tests:
|
<CFIF
Variable IS "True"> <!--- This is the text value TRUE --->
<CFIF Variable IS True> <!--- This is the Boolean value TRUE ---> |
|
<CFIF Variable IS "100"> <!--- This is the text value 100 --->
<CFIF Variable IS 100> <!--- This is the numeric value 100 ---> |
Both of these groups operated at exactly the same speeds, even though one was treating a value as text and the other was treating it as a Boolean or a number. This says that some other operation is going on than plain text comparison.
|
<CFIF Not Compare(Variable, 'value')>
<CFIF Not CompareNoCase(Variable, 'value')> |
These functions are a lot more intuitive, but also more problematic. The functions will take two values and compare them. If the first value is in the second value, the function will return the numeric position of the match. The problem is, this can be ANYWHERE in the second value. This means that a simple comparison that looks like it should logically work can fail.
|
<CFIF FindNoCase('admin', 'useradmin')>
<CFIF FindNoCase('admin', 'administrator')> |
The first example will return a 'TRUE' result to a CFIF that uses it, but the actual result is 5. The second will also return a 'TRUE' result and the value will be 1, but it's not an exact match for what we were expecting. With some fine control this can be used, but is too prone to problems for my taste.
|
<CFIF Find(Variable, 'value')>
<CFIF FindNoCase(Variable, 'value')> |
|
<CFIF REFind('value', Variable)>
<CFIF REFindNoCase('value, Variable)> |
My advice after all this is to go through all your code, look for any places that have a standard CFIF, and change it to one of the above functions. You'll save in speed and in the end, that's all that matters. To make your job a little easier, this Regular Expression will work in Studio to find every location that should be changed:
|
<CFIF[^>]+ IS [^>]+>
|
It might also be a smart idea to comment all the changes. It might save your life if you ever have to change it all back. :)
[Top]
By now, anyone in the CF community who's paying the least bit of attention knows that ColdFusion for Linux is just around the corner. In some ways, it's really nothing special; it's the same ColdFusion we have come to know and love, just on a different platform. In fact, there are a couple of features missing, like Verity and Advanced Security, due to lack of support for Linux in those components.
So, why should you care about CF for Linux?
Obviously, all of the penguin crowd will flock to the Linux version, with shouts of "stability!", "performance!", "it's not Microsoft!", etc.... Personally, I don't get too worked up over that. My NT boxes have all been very stable and reliable, real-life performance benchmarks have not yet been done to what I would call a reasonable standard, and while I don't always like what Microsoft does, I don't have any irrational phobias about using their products.
So why do I practically drool over the prospect of CF on Linux? Three words: Remotely Administered Servers. NT is fine, so long as you have direct keyboard access to it, but when you have to deal with an NT server located in another room, another city, or another country, things start to look a bit different. (Yes, I know about PC Anywhere, VNC, and other remote control software, but I've never been completely satisfied with them, since it is yet another piece of software to cause trouble.) Linux brings us to the point where I don't even need a keyboard, mouse or monitor attached to the computer, it will run just fine without them. And since Linux is a primarily command-line system, a telnet session (or SSH for the security-minded) is "just like being there." I can do anything I want to my Linux servers from any location, so long as it does not involve actual manipulation of hardware. This includes installing software, re-booting, and stopping and starting daemon processes (services). It's even possible to mount a CD remotely if you're willing to do a little work.
Another feature I feel is highly underrated by the Windows crowd is the ability to "strip the system down" to only the essential components. Windows NT by it's very nature has a lot of overhead before you even install ColdFusion. Linux, on the other hand can be run stripped down to the bone. For a good server install, I always do an absolute minimal install, then custom install only the components I need (Apache, ColdFusion, SSH, ...). This gives me a box that performs better, and has fewer security holes.
Lastly, because everything on Linux is based on the command-line, automating processes is very easy. Write the script, schedule it with cron, sit back and let it run. My box automatically emails my log files to me, deletes the old ones, scans the logs for problems, etc.... I can schedule processes to be stopped or started, content to be synchronized, configuration file modifications, or any other possible maintenance task.
Now, don't buy into all the fervor about how "easy" it is to use Linux. You're not going to learn it well enough in a day to install a production server. You didn't learn NT in a day, and this will certainly be no different. Find an old box, get a copy of RedHat 6.1, and start experimenting. Soon enough, you'll be confident enough to start using Linux as a development server, then for production. Also, chances are that you've got a Linux User Group in your area. Find out where they meet, and drop in. The User Groups are a fantastic means of getting non-urgent support.
Don't fear the penguin!
[Top]
| This is an opt-in magazine. To join, leave or change subscription mode, please visit the signup page. All content of this magazine is copyright Fusion Authority, Inc. It may not be reproduced without permission. | ||