{"action":"created","issue":{"url":"https://api.github.com/repos/colinhiggs/pyramid-jsonapi/issues/147","repository_url":"https://api.github.com/repos/colinhiggs/pyramid-jsonapi","labels_url":"https://api.github.com/repos/colinhiggs/pyramid-jsonapi/issues/147/labels{/name}","comments_url":"https://api.github.com/repos/colinhiggs/pyramid-jsonapi/issues/147/comments","events_url":"https://api.github.com/repos/colinhiggs/pyramid-jsonapi/issues/147/events","html_url":"https://github.com/colinhiggs/pyramid-jsonapi/pull/147","id":294038178,"number":147,"title":"JSONSchema optimisations","user":{"login":"mrichar1","id":478653,"avatar_url":"https://avatars0.githubusercontent.com/u/478653?v=4","gravatar_id":"","url":"https://api.github.com/users/mrichar1","html_url":"https://github.com/mrichar1","followers_url":"https://api.github.com/users/mrichar1/followers","following_url":"https://api.github.com/users/mrichar1/following{/other_user}","gists_url":"https://api.github.com/users/mrichar1/gists{/gist_id}","starred_url":"https://api.github.com/users/mrichar1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mrichar1/subscriptions","organizations_url":"https://api.github.com/users/mrichar1/orgs","repos_url":"https://api.github.com/users/mrichar1/repos","events_url":"https://api.github.com/users/mrichar1/events{/privacy}","received_events_url":"https://api.github.com/users/mrichar1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-02-02T22:06:53Z","updated_at":"2018-02-02T22:10:50Z","closed_at":null,"author_association":"COLLABORATOR","pull_request":{"url":"https://api.github.com/repos/colinhiggs/pyramid-jsonapi/pulls/147","html_url":"https://github.com/colinhiggs/pyramid-jsonapi/pull/147","diff_url":"https://github.com/colinhiggs/pyramid-jsonapi/pull/147.diff","patch_url":"https://github.com/colinhiggs/pyramid-jsonapi/pull/147.patch"},"body":"It appeared that there were some inefficiencies in calling JSONSchema methods repeatedly (for example from the OpenAPI module) due to the use of `copy.deepcopy` to make modified copies of the schema dict for different endpoints.\r\n\r\nThe performance is good under python >= `3.6` but poor on `3.5` and below - `3.6` has had a lot of optimisations in both `dict` handling and `deepcopy`, not least moving many of these functions into dedicated C libraries.\r\n\r\nThe easiest 'fix' for this is to use `pickle` instead of `deepcopy`. Doing a `pickle.loads(pickle.dumps(x))` is fast as it all happens in C, and while it is not a universal equivalent to `deepcopy`, it is safe in this instance since the schema is JSON in origin so shouldn't contain any things which `pickle` might baulk at.\r\n\r\nPerformance in generating the OpenAPI specification in a test app (40 endpoints) is now approximately 12 times faster!"},"comment":{"url":"https://api.github.com/repos/colinhiggs/pyramid-jsonapi/issues/comments/362722603","html_url":"https://github.com/colinhiggs/pyramid-jsonapi/pull/147#issuecomment-362722603","issue_url":"https://api.github.com/repos/colinhiggs/pyramid-jsonapi/issues/147","id":362722603,"user":{"login":"coveralls","id":2354108,"avatar_url":"https://avatars1.githubusercontent.com/u/2354108?v=4","gravatar_id":"","url":"https://api.github.com/users/coveralls","html_url":"https://github.com/coveralls","followers_url":"https://api.github.com/users/coveralls/followers","following_url":"https://api.github.com/users/coveralls/following{/other_user}","gists_url":"https://api.github.com/users/coveralls/gists{/gist_id}","starred_url":"https://api.github.com/users/coveralls/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coveralls/subscriptions","organizations_url":"https://api.github.com/users/coveralls/orgs","repos_url":"https://api.github.com/users/coveralls/repos","events_url":"https://api.github.com/users/coveralls/events{/privacy}","received_events_url":"https://api.github.com/users/coveralls/received_events","type":"User","site_admin":false},"created_at":"2018-02-02T22:10:50Z","updated_at":"2018-02-02T22:10:50Z","author_association":"NONE","body":"\n[![Coverage Status](https://coveralls.io/builds/15352637/badge)](https://coveralls.io/builds/15352637)\n\nCoverage decreased (-0.07%) to 93.245% when pulling **a0a14c44beb4d6871014e0893b6bcbb5dd759e51 on jsonschema_fixes** into **80fc039d54dc714bbbb8fd20b5b16990eb39c9b3 on master**.\n"}}
{"actor":{"display_login":"coveralls"}}