Add new attachment

Only authorized users are allowed to upload new attachments.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
java
FileUtil.java 8.7 kB 3 02-Oct-2005 12:53 KeesKuip
patch
VersioningFilePageExistPatch.p... 3.4 kB 1 15-Oct-2005 18:03 KeesKuip
java
VersioningFileProvider.java 20.1 kB 2 02-Oct-2005 12:38 KeesKuip
patch
VersioningFileProvider.patch 1.4 kB 1 05-Oct-2005 19:16 KeesKuip
java
WikiEngine.java 62.7 kB 1 04-Oct-2005 19:58 KeesKuip
patch
WikiEngine.patch 0.3 kB 1 05-Oct-2005 19:16 KeesKuip
png
profile.png 84.7 kB 1 02-Oct-2005 14:20 KeesKuip

This page (revision-44) was last changed on 26-Sep-2007 23:05 by JanneJalkanen  

This page was created on 24-Sep-2005 01:28 by KeesKuip

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Difference between version and

At line 7 changed one line
|[Bug status]|NewBug
|[Bug status]|ClosedBug
At line 162 added 52 lines
That would be a right way to do it, yes. The trouble is that that breaks the API, and I want to change the API completely anyway... I'd rather do it in full.
However, note that page histories are being cached. If pageExists() were to call getVersionHistory() and check it from that list, it might be a lot faster (except for simple cases).
-- JanneJalkanen
Couldn't we decide to hack PageManager and CachingProvider it only for speeding up VersioningFileProvider? I think a complete rebuild of Provider would take a serious amount of time.
I really think this is a problem. I timed the time it needs to click 'More info' on the www.jspwiki.org and it took 2,5 minutes! That's 2,5 minutes that the wiki is taking 100% cpu (now imagine 24 people clicking on it in 1 hour). This is one of the first things a new user of jspwiki notices (I noticed it anyway).
-- KeesKuip
Hacking PageManager and CachingProvider is okay; but changing the API should be done very carefully, and preferably many changes at a time. Otherwise you end up with "this provider works with 2.2.12, this provider with 2.3.42-2.3.85, this provider with 2.4.x, but not with 2.4.5-7", etc. This gets very confusing to the users at some point. This is why I would like to make major changes all at once.
So, I would like to investigate if there are things we can do with the current code base that does not involve changing the API... Those changes can even be drastic, we'll clean them up later.
-- JanneJalkanen
Here's the patch [VersioningFilePageExistPatch.patch].
The WikiEngine now asks the pageManager.pageExist(pageName, version). If the provider is a CachingProvider and that CachingProvider has a realProvider of VersioningFileProvider I ask directly the PageInfo from the VersioningFileProvider. The results are below.
Results:\\
before: 62182 / 52527 / 52050 msec.\\
after: 7835 / 4118 / 5619 msec.\\
I fabricated the patch with the command : 'diff -u changed_file original_file'. Is that the right way to do it?
-- KeesKuip
Thanks! I looked into it, but I figured it would be dumb to just tie it to a single provider. So I created a VersioningProvider interface with {{"pageExists( String name, int version"}} and made VersioningFileProvider and CachingProvider implement it. It's now ''very'' fast. The change is in 2.3.30, now in CVS.
The correct command would be "diff -Naur <original_file> <new_file>", for example:
{{{
diff -Naur JSPWiki_orig/ JSPWiki_mychanges/
}}}
Try to use this from a top -level directory, i.e. not "diff -Naur ../../../JSPWiki_orig/src/com/ecyrd/jspwiki/Release.java Release.java". This confuses all patch programs.
-- JanneJalkanen
Thanks, I checked the latest source out with the following results:\\
4569 / 4303 / 2232 msec.\\
That is an improvement of 60-100x of the first results.
-- KeesKuip
Well, thanks for providing such a good profile; it was easy to fix after your hard work!
-- JanneJalkanen
Version Date Modified Size Author Changes ... Change note
44 26-Sep-2007 23:05 11.516 kB JanneJalkanen to previous
43 26-Sep-2007 01:43 11.547 kB 222.221.6.144 to previous | to last
42 26-Sep-2007 01:28 11.537 kB 219.138.204.162 to previous | to last
41 26-Sep-2007 01:27 11.525 kB 207.44.238.95 to previous | to last
« This page (revision-44) was last changed on 26-Sep-2007 23:05 by JanneJalkanen