View Single Post
  #163  
Old June 19th, 2012, 07:05 PM
lch's Avatar

lch lch is offline
General
 
Join Date: Feb 2007
Location: R'lyeh
Posts: 3,861
Thanks: 144
Thanked 403 Times in 176 Posts
lch is on a distinguished road
Default Re: Official release of the unofficial Dominions 3 Wiki

Quote:
Originally Posted by JonBrave View Post
Here's what I don't get/is sad. Your Wiki is, or should be, 99.9% static text. No offence intended, but as I recall it's just clicking on links to other pages (little if any interaction)
Like others already wrote, far from it. It's probably pretty close to the other way around. Almost everything, including in most parts the graphics, is dynamically generated. There are caching mechanism in place, especially for the graphics, so that it doesn't have to be generated completely if there is a hit, of course. But what is stored in the MySQL database is something called Wikitext, which is being rendered into what you see on your screen. The Wikitext is just some very sleek text with Wiki-specific markup which aims to be very readable even when you edit the source code in the editor, instead of HTML for example, where your actual text can get lost in all the tags and markup it carries. And unlike HTML, that Wikitext has to be parsed by the server, not only on your side by your browser. That whole Wikitext runs through the MediaWiki parser before you see it, and MediaWiki, the Wiki software, has some very wicked Templating mechanism built-in, too. It's a very complex Turing-complete language, if you want, which differentiates it from a WYSIWYG Content Management System where you use a finite set of tools. Oh, and the MediaWiki software itself with the included parser is programmed in PHP, which is an interpreted language that has to run through a PHP parser at runtime before it is being executed, too. So there are a couple of parsers simultaneously at work at the server on different levels whenever the Wiki has to spit something out on your screen.

Of course, the aim is to keep the actual rendering low as much as possible. Which is why I am using something called APC, Advanced Parser Cache, to always keep the things which are used the most in memory. And theoretically, all the rendering should only be necessary if somebody makes a change to one of the pages. But there's just not enough memory to keep all the thousands of pages in memory at once, which is why you do have those load times (and sometimes it seems to get stuck at some point, I don't know why). When I wrote that the Wiki is probably slow either because of my net connection (I doubt it) or the server hardware (quite possible), I forgot one other thing: It might very much be slowed down by the design, too. I am using extensions, like SMW, Semantic MediaWiki, which could probably be used better. I'm using Templates that could probably be optimized. A couple of pages could probably be formatted in a better way, and most of all: The unit pages, which I'm guessing are being accessed the most, are using a design which is maybe not very cache-friendly. It accesses an internal MySQL database of stats and values quite similar to Edi's Dom3DB which I separated from the MediaWiki articles so that I'd have it easy to update those stats and values when a new update to Dom3 changes them. Back when the Wiki was developed, there were more or less regular updates every half year, and quite a lot of little data changes could happen in a patch. Populating that data into the Wikitext from the unit articles would be painful manual labor, or I'd have to write my own parser/robot to find and change that information, so I wrote a MediaWiki extension which grabs that data from another internal database instead. Nowadays Dom3 is pretty much final and there haven't been any major patches to the content lately, so such a setup is not as necessary as it seemed to be at first, and I could probably lose that design. I didn't knew about the power of Semantic MediaWiki when I started this design, too, and I probably could have dismissed this strange design from the start. Like I wrote in my opening post, I think there's probably a lot more powerful stuff to be harnessed from SMW, but I lack the knowledge and the time to learn it outside of a paid work experience myself now.

I'm still hoping that a SMW wizard might come by at some point, weave his magic wand and suddenly everything will just be beautiful and lightning fast... In the meantime, you'll have to live with things the way they are now. Not ideal, but you'll have to cope.
__________________
Come to the Dom3 Wiki and help us to build the biggest Dominions-centered knowledge base on the net.
Visit my personal user page there, too!
Pretender file password recovery
Emergency comic relief

Last edited by lch; June 19th, 2012 at 07:18 PM..
Reply With Quote