-
- 34 Posts
Hi Tim,
I have just download the current version (2.0 beta) for Revo, and I’m getting a verbose output, starting with:
Search Terms array: array(1) { [0]=> string(8) "stamford" }
Search Terms negative array: array(0) { }
Neg query 1:
Neg query 2:
SELECT DISTINCT `tgsketch_cranf`.`site_content`.id, `tgsketch_cranf`.`site_content`.editedon FROM `tgsketch_cranf`.`site_content` LEFT JOIN
.......
How do I turn that off, please?
Thomas
-
- 172 Posts
Sorry, I uploaded the file with debugging on. Either find the line "define(’DEBUG’, 1);" and change 1 to 0, or get the version I have just uploaded to my site.
-- Tim.
-
- 34 Posts
Thought it might be something like that ;-)
Thanks for quick response
Thomas
-
- 219 Posts
Hi,
Love the snippet! I have set this up on a Revolution Site I’m working on and I have a question about the time it takes to return the results page.
Currently it takes 12.5096 seconds to return 49 items on the results page. This seems alot to me and am wondering what other peoples results are with this snippet? I’m concerned because once the site is finished, it will be searching over 1500 pages.
I have no problems with speed on any other page or snippet, front end or in the manager.
Thanks in advance for any advice!
-
- 172 Posts
Hi,
I’ve just done some timings on an Evo site with 756 resources/documents in the site_content. Its a busy site and as such is on a dedicated server. To what extent this affects things I don’t know, but if a shared hosting company is packing them in enough for it to make a difference to a single page load time I suspect you need a different hosting company.
For comparison, the normal page load time on this site is usually 300-500ms, minimum 270ms, maximum 740ms.
Search results load time 1-3s in most cases (typically 20-40 results). Not super fast, admittedly, but not problematical in this case. One large result set (323 documents) took 5.25s, but this was the most extreme case.
These times include the network overheads, but I think its fair to say that the majority of the search page time is processing. Offhand I can’t be 100% sure how it scales, but I think the PHP execution time (not including SQL queries) in most cases will be linear according to the total finds as the number of documents gets very large (*).
I don’t know enough to comment on the MySQL execution time, but I’d would expect that to be less significant the the PHP. There is one query and I expect it could be optimised, but I doubt whether it would make much difference. I would have though that you’d have other problems with MODx and site size well before MySQL slowed down enough to be a problem.
12s seems rather long. How many documents is it currently searching? I suggest you try another server, or if you can edit PHP, edit the snippet code and run some tests.
I also suggest you try other search code for comparison (I only know of SimpleSearch, but I don’t know much about Revo). Much as I’d like to think my own code is faster, it may not be, especially as there is alot of non-obvious processing going on in the background to elimate false positives (**) and build the search extract. It would certainly be possible to write quicker search code if you were prepared to trade speed for a few occasional ’wrong’ results or if you just stuck to single byte character sets.
Note also that the comparison with other snippets isn’t entirely fair - how many other pages are there on your site that have to look at you entire site’s content?
-- Tim.
(*) actually linear according to total finds including false positives returned from MySQL. In most cases there will be zero false positives. Further explanation is probably a bit OTT for this thread, so see the code source.
(**) It’s a contrived and extreme example, but consider what would happen if a search snippet just did a crude search in some html content for the string ’div’.
-
- 219 Posts
Thanks for your reply Tim. The timings you have mentioned are what I would expect, maby its not working so well with revo? Have run another test:
1 document found containing "robert"
0.0208 s - Query Time - Shows how long MODx took talking to the database
2 - Query Count -Shows how many database queries MODx made
0.5036 s - Parse Time - Shows how long MODx took to parse the page
0.5244 s - Total Time - Shows the total time taken to parse/ render the page
cache - Source - Shows the source of page, whether is database or cache.
68 documents found containing "the"
0.0085 s - Query Time - Shows how long MODx took talking to the database
2 - Query Count -Shows how many database queries MODx made
17.7421 s - Parse Time - Shows how long MODx took to parse the page
17.7506 s - Total Time - Shows the total time taken to parse/ render the page
cache - Source - Shows the source of page, whether is database or cache.
As you can see the times at the moment are far to long to make this viable. Can you think of anything that may be causing this? So strange considering I have had no problems.
Thanks