Last modified: 2009-03-25 11:48:56 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T20148, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 18148 - Faster short circuit and bugfix for check syntax errors
Faster short circuit and bugfix for check syntax errors
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
AbuseFilter (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Andrew Garrett
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-03-25 07:40 UTC by Robert Rohde
Modified: 2009-03-25 11:48 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Patch and bugfix to extend short circuiting. (4.56 KB, patch)
2009-03-25 07:40 UTC, Robert Rohde
Details

Description Robert Rohde 2009-03-25 07:40:30 UTC
Created attachment 5959 [details]
Patch and bugfix to extend short circuiting.

The attached patch extends the short circuit handling to more efficiently bypass unnecessary sub-expressions.  At the same time the patch fixes check syntax errors related to short circuiting.

Based on benchmarking with function evaluation and variable lookup hacked off, the extended short circuiting results in a ~20% improvement in parser speed for typical cases.

Regarding the syntax check bug:

Currently short circuiting allows some expressions to pass syntax validation even though they contain unknown keywords.  An example of such an expression is "added_lines & applesauce", which validates as okay even though "applesauce" is meaningless.

This patch includes logic that fixes this short circuiting bug.
Comment 1 Andrew Garrett 2009-03-25 07:46:27 UTC
true && someBool is a useless no-op. Otherwise seems to be okay. Will have a closer look soon.
Comment 2 Robert Rohde 2009-03-25 07:56:42 UTC
Yes, = true && Bool could be reduced to just = Bool.  I left it like that without really thinking, since the original value was (and the typical mode of execution is) = true.
Comment 3 Andrew Garrett 2009-03-25 11:48:56 UTC
Applied with minor changes in r48808.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links