tracker issue : CF-3719927

select a category, or use search below
(searches all categories and all time range)
Title:

Criteria Building in ColdFusion is god damn slow as hell

| View in Tracker

Status/Resolution/Reason: Closed/Withdrawn/CannotReproduce

Reporter/Name(from Bugbase): Andrew Scott / Andrew Scott (Andrew Scott)

Created: 03/07/2014

Components: ORM Support

Versions: 11.0

Failure Type: Performance Issue

Found In Build/Fixed In Build: PublicBeta /

Priority/Frequency: Major / Most users will encounter

Locale/System: English / Win 2012 Server x64

Vote Count: 0

Problem Description:

The following Blog post shows the test and the results.

http://www.andyscott.id.au/blog/coldfusion-orm-and-things-one-should-consider-and-is-criteria-building-a-good-option

I know that there is a performance hit every time one use Criteria Builder, but not to these timings differences.

Actual Result:

Expected Result:

Any Workarounds:

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3719927

External Customer Info:
External Company:  
External Customer Name: ascott67
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

Can you please put the details as the reference web page is not available. (Comment added from ex-user id:nawani)
Comment by Adobe D.
13106 | December 08, 2014 03:22:51 AM GMT
Done.
Comment by External U.
13107 | December 08, 2014 03:31:17 AM GMT
In the blog post, you are referring to ColdBox criteria API being so slow. So is it ColdFusion bug or ColdBox bug?
Comment by Rupesh K.
13108 | December 08, 2014 05:29:15 AM GMT
Rupesh. It is ColdFusion that is slow.
Comment by External U.
13109 | December 08, 2014 03:06:47 PM GMT
Just saying that it is a ColdFusion bug does not help. Please provide us a repro case taking ColdBox out of picture.
Comment by Rupesh K.
13110 | December 09, 2014 12:33:07 AM GMT
I can't Rupesh, I don't know enough about extracting the Criteria Builder usage from within ColdBox. All I can say is that the it is the actual query itself here. /** * Comment listing for UI of approved comments, returns struct of results=[comments,count] * @contentID.hint The content ID to filter on * @contentType.hint The content type discriminator to filter on * @max.hint The maximum number of records to return, 0 means all * @offset.hint The offset in the paging, 0 means 0 * @sortOrder.hint Sort the comments asc or desc, by default it is desc */ function findApprovedComments(contentID,contentType,max=0,offset=0,sortOrder="desc"){ var results = {}; var c = newCriteria(); // only approved comments c.isTrue("isApproved"); // By Content? if( structKeyExists(arguments,"contentID") AND len(arguments.contentID) ){ c.eq("relatedContent.contentID",javaCast("int", arguments.contentID)); } // By Content Type Discriminator: class is a special hibernate deal if( structKeyExists(arguments,"contentType") AND len(arguments.contentType) ){ c.createCriteria("relatedContent") .isEq("class", arguments.contentType); } // run criteria query and projections count results.count = c.count(); results.comments = c.list(offset=arguments.offset,max=arguments.max,sortOrder="createdDate #arguments.sortOrder#",asQuery=false); return results; } The line that holds 99.9% of the execution times is this line c.list(offset=arguments.offset,max=arguments.max,sortOrder="createdDate #arguments.sortOrder#",asQuery=false); You may need to talk to Luis more about how it works, I no longer develop in ColdFusion and this bug is one of those reasons that I have moved on.
Comment by External U.
13111 | December 09, 2014 02:26:47 AM GMT
Hi Adrew, I am unable to access the link which you have shared to repro this issue. Is it possible if you can share more details with me so that I can start investigating further. Thanks for your co-operation.
Comment by Nimit S.
13112 | September 21, 2015 08:49:41 AM GMT