{"issue":{"user":{"id":1240282,"login":"jsamuel","url":"https://api.github.com/users/jsamuel","avatar_url":"https://secure.gravatar.com/avatar/bc1d195cedb959a3946572b08ce9e7c7?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"bc1d195cedb959a3946572b08ce9e7c7"},"milestone":null,"title":"Import Hangs on ~500K Policies","created_at":"2011-12-22T05:59:34Z","labels":[{"name":"extension","url":"https://api.github.com/repos/RequestPolicy/requestpolicy/labels/extension","color":"ededed"}],"updated_at":"2011-12-22T05:59:34Z","state":"open","id":2634405,"closed_at":null,"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"html_url":"https://github.com/RequestPolicy/requestpolicy/issues/193","body":"Given the patches presented in [ticket:190#comment:1], tried to expand a single regex of the form:\r\n\r\n{{{http://leaf[0-9]{2}.parent[0-9].node.example.com}}}\r\n\r\nThis yields:\r\n\r\n~1,000 Policies for {{{http://example.com}}} to any leaf.\r\n~500,000 Policies for any leaf to any leaf\r\n\r\nYes, '''that''' many policies can be represented by a single regular expression -- and the only reason to expand one as such, is that #8 is still pending...\r\n\r\nFortunately, I had imported as TEMPORARY to ensure that the policies would not persist if an OOM condition occurred.\r\n\r\nImporting ~1,000 policies worked without noticeable impact, even when queried during browsing; however, importing ~500,000 policies completely hung firefox during import.\r\n\r\nNot quite patient enough to wait and see if an OOM would eventually result, if it would crash prior, or just ''really'' slow to a crawl, I killed the process after several minutes of swap file induced disk thrashing.\r\n\r\nI anticipate most users would never reach even 1,000 policies unless importing, such as if request policy was used as some sort of organizational policy with a comprehensive policy set for the organization.  Still, there are better ways to implement that as well.\r\n\r\nNevertheless, the import dialog should probably check the length of the file before trying to blindly import the file and warn the user if the file contains more than '''X''' policies (really just lines, each are potential policies -- blanks are ignored and there are a few headers).   The user should be warned to the effect that such a large import can noticeably impact the browsing experience, and has a potential for detrimental effects, eg an OOM condition...\r\n\r\nNow we just need to identify what a reasonable '''X''' is... 10,000?","number":193,"url":"https://api.github.com/repos/RequestPolicy/requestpolicy/issues/193","comments":0,"assignee":null},"action":"opened"}