Performance: with and without Twitter profile embed

Written on 20 February 2018, 09:33am

Tagged with: , ,

With Twitter:

Without Twitter:

Tests ran with Pingdom

Maybe TweetNest can help?

1. Improve ColdFusion performance by 1000x?

I recently had to deal with some ColdFusion page optimization. Although the result was not 1000 better like in this case, the approach was more or less similar. Instead of SQL indexes + rewriting queries inside loops + caching queries, I only had to do a combination of:
– reducing the number of DB queries by moving them outside loops
– using cfqueryparam. In addition to making things more secure, turns out it also has a significant impact on performance tuning.

Update: Some more improvements:
– ColdFusion whitespace management
getting rid of the old cfform
gzipping the content transferred to the browser

The end result was a 30x-50x performance improvement.

2. About helping others

Apparently helping others is embedded in every human’s DNA. Here’s an excerpt (no spoilers) from Andy Meir’s ‘The Martian’ – one of the best SF novels I ever read:

Every human being has a basic instinct to help each other out. It might not seem that way sometimes, but it’s true. […] This is so fundamentally human that it’s found in every culture without exception. Yes, there are assholes who just don’t care, buy they’re massively outnumbered by the people who do.
The Martian (coming in a theater near you in 2015)

The downside of this ‘feature’ of the human behavior is that it can be exploited. For example, in computer security, individuals who are attempting to social engineer some piece of information strongly rely on this aspect of the human nature:

Don’t rely on network safeguards and firewalls to protect your information. Look to your most vulnerable spot. You’ll usually find that vulnerability lies in your people. […]
Most people generally want to help somebody who is requesting help.
CompTIA Security

3. The Rosie Project

The Rosie project is an amazingly enjoyable book about a socially-challenged scientist who is working his way through the process of finding a life partner. Also recommended by Bill Gates. If anyone makes a movie out of it, I hope they pick Jim Parsons for the main role 🙂

ColdFusion performance: compare to 0 in cfloop

Written on 6 December 2014, 11:31am

Tagged with: ,

The piece of code below proves that in ColdFusion comparing to 0 and using a negative step is more efficient than the traditional way of looping.

<cfset LOOPS1 = 5>
<cfset LOOPS2 = 100*1000>

<cfset STEPS = 10>

<cfloop index="k" to="0" from="#STEPS#" step="-1">
	<cfset start = GetTickCount()>
	<cfloop index='i' from='0' to='#LOOPS1#' step='1'>
		<cfloop index='j' from='0' to='#LOOPS2#' step='1'>
	<cfset exectime1 = GetTickCount() - start>

	<cfset start = GetTickCount()>
	<cfloop index='i' from='#LOOPS1#' to='0' step='-1'>
		<cfloop index='j' from='#LOOPS2#' to='0' step='-1'>
	<cfset exectime2 = GetTickCount() - start>

	<cfset diff = exectime1 - exectime2>

Ran on Railo 4.2 produced the following output: