Last modified: 2014-02-21 14:49:09 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 T43693, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 41693 - Support short-circuit bool ops
Support short-circuit bool ops
Status: NEW
Product: MediaWiki extensions
Classification: Unclassified
AbuseFilter (Other open bugs)
unspecified
All All
: Low normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
: 51784 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-11-02 14:25 UTC by Liangent
Modified: 2014-02-21 14:49 UTC (History)
8 users (show)

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


Attachments

Description Liangent 2012-11-02 14:25:04 UTC
It will speed up lots of filters.
Comment 1 Liangent 2012-11-02 14:27:26 UTC
Adding vvv to CC who is the author of AF parser.
Comment 2 Victor Vasiliev 2012-11-04 02:00:48 UTC
But they *do* short-circuit now, though not in a proper way.
Comment 3 Liangent 2012-11-04 11:43:37 UTC
(In reply to comment #2)
> But they *do* short-circuit now, though not in a proper way.

I just see some filters only saying `cond1 & cond2` where cond1 is very cheap and is false for most of edits (for example, user_name == 'FooBar') but cond2 is some more expensive consume more condition limit than expected (in short-circuited evaluation).
Comment 4 Kunal Mehta (Legoktm) 2013-07-22 09:37:29 UTC
*** Bug 51784 has been marked as a duplicate of this bug. ***
Comment 5 Helder 2013-07-22 10:06:30 UTC
From Bug 51784:
Currently, if I create a filter having the code
-------------------------------------
false & false & false & false & false
-------------------------------------
and then make an edit in any page, the filter's page will have a message saing
"... it consumes 5 conditions of the condition limit."

There is no reason for it to consume the last 4 conditions, because the first
one is already false.

Notice the behavior is a little better if the code is changed to
-----------------------------------------
false & ( false & false & false & false )
-----------------------------------------
because it will now consume just 2 conditions. Ideally, it should consume only
1 condition in both cases (see [[Short-circuit evaluation]]).

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


Navigation
Links