Ticket #83 (new defect)

Opened 2 years ago

Last modified 1 month ago

Change cfswtich/cfcase statements to cfif/cfelseif/cfelse block

Reported by: MaestroFJP Owned by: bbowden
Type: defect Priority: normal
Milestone: Reactor 2.0 Alpha Component: Reactor - Core Framework
Version: 1.0 Severity: normal
Keywords: spam Cc:

Description

If you looking for every ounce of speed, I'd highly recommend changing
the cfswitch statements that evaluate strings in the cfcase (i.e. most
notably ObjectDao.cfc's) to cfif-cfelseif-cfelse blocks. Check out the
post from the guys at WebApper for more info about what is going on
behind the scenes:
CFSwitch Hunt -
http://webapper.net/index.cfm?fuseaction=Fuseblog.ShowComments&ArticleID=200
60727042244

I do did a load test on Mach-II's string cfswitch block that loads the
commands for event-handlers and one using cfif-etc. blocks. On my test
application I showed about 6-8% improvement in load times just by moving
away from cfswitch when it evaluates strings as the cases (numerics are
not affected). This is one of the improvements that made it into 1.1.1
which is in beta right now. Also, when using cfif-cfelseif-cfelse
blocks be sure to put the most used data types first since "if" blocks
short circuit once a match is found (yeah, I know simple, but effective
thinking here).

Change History

Changed 2 years ago by bbowden

  • owner changed from dhughes to bbowden

Changed 2 years ago by bbowden

Some files have been changed in revision 380.

Changed 2 years ago by dhughes

  • milestone changed from Release Candidate 1 (RC1) to Reactor 2.0 Alpha

I don't plan to make this change in Reactor 1.0. Right now it's plenty fast. (Not that that's subjective or anything.) All in all, the cached OO queries made a huge performance improvement and I don't see the undying need for this right now.

Changed 1 month ago by TomChiverton

  • keywords spam added
Note: See TracTickets for help on using tickets.