{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":52151902,"defaultBranch":"master","name":"kaitai_struct_python_runtime","ownerLogin":"kaitai-io","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2016-02-20T12:20:35.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/17322584?v=4","public":true,"private":false,"isOrgOwned":true},"refInfo":{"name":"","listCacheKey":"v0:1677937920.701046","currentOid":""},"activityList":{"items":[{"before":"812ae7eef816b4459566739767312842e37d37c5","after":"07aea9c6cdb1cc5be8677004680382602d7323f3","ref":"refs/heads/master","pushedAt":"2024-07-23T11:58:26.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"generalmimon","name":"Petr Pučil","path":"/generalmimon","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/47499687?s=80&v=4"},"commit":{"message":"Add bytes_terminate_multi() and read_bytes_term_multi()\n\nSee https://github.com/kaitai-io/kaitai_struct/issues/187","shortMessageHtmlLink":"Add bytes_terminate_multi() and read_bytes_term_multi()"}},{"before":"92a2d71519ba1c99390f2755ab0ec0c635176f40","after":"812ae7eef816b4459566739767312842e37d37c5","ref":"refs/heads/master","pushedAt":"2024-07-22T18:22:34.000Z","pushType":"push","commitsCount":2,"pusher":{"login":"generalmimon","name":"Petr Pučil","path":"/generalmimon","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/47499687?s=80&v=4"},"commit":{"message":"read_bytes_term(): additional minor performance improvements\n\nSee the `new_v2` version at\nhttps://gist.github.com/generalmimon/41dcb2bba48cb47c2f30ce9f086cbbf2 -\nit's about 10% faster than the existing `new` version.","shortMessageHtmlLink":"read_bytes_term(): additional minor performance improvements"}},{"before":"d457617e86347e74a0cc36b501bf58dfdeb40656","after":"92a2d71519ba1c99390f2755ab0ec0c635176f40","ref":"refs/heads/master","pushedAt":"2023-09-28T12:47:33.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"generalmimon","name":"Petr Pučil","path":"/generalmimon","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/47499687?s=80&v=4"},"commit":{"message":"bytes_terminate(): speed up by avoiding unnecessary memory copying\n\nThis rewrite of the bytes_terminate() function fixes performance issues\nof the old version without any known performance regressions.\n\n`bytes.partition()` used before is quite fast on its own for what it's\nsupposed to do. However, there were two measurable performance issues in\nour use of it, if we consider that the `data` argument is an immutable\n`bytes` object (which is true in practice, since our read_bytes() method\nreturns `bytes` objects):\n\n1. See https://docs.python.org/3/library/stdtypes.html#bytes.partition:\n\n > Split the sequence at the first occurrence of sep, and return a\n > 3-tuple containing the part before the separator, the separator\n > itself or its bytearray copy, **and the part after the separator**.\n\n The important part is that it creates and returns the part _after the\n separator_ even though we don't need it. Unfortunately, as of Python\n 3.11.5, slicing an immutable `bytes` object incurs a memory copy,\n i.e. it is not a zero-copy operation. In other words, the\n bytes_terminate() function unnecessarily copied all bytes after the\n terminator, only to not use it afterward. Of course, it's faster to\n copy only the part up to the terminator - the earlier the terminator\n occurs, the faster the operation.\n\n2. The `include_term=True` was significantly slower than\n `include_term=False`. This is because `bytes.partition()` always\n returns the part before the separator, but if we have a non-empty\n terminator byte to include, we have no other option than to\n concatenate two `bytes` objects. This copies memory because `bytes`\n objects are immutable.\n\nSee the benchmark at\nhttps://gist.github.com/generalmimon/dcaec4d005d0d1a87bd237d94199203a\n(results from Python 3.10.12 in WSL 2 on my computer are at the bottom) -\nwe can clearly see both mentioned issues. For `include_term=False`, if\nthe terminator is in the middle of a 128 KiB byte array, the new\nimplementation is 1.8x faster due to the issue 1) above. If the\nterminator is near the end of these 128 KiB or is missing, there's no\nmeasurable difference between the implementations. For\n`include_term=True`, the new version is 2.0x faster than the old one if\nthe terminator is near the end due to 2) - the new impl has the same\nperformance regardless of `include_term`, whereas in the old impl\n`include_term=True` was twice as slow as `include_term=False`.","shortMessageHtmlLink":"bytes_terminate(): speed up by avoiding unnecessary memory copying"}},{"before":"c0c454bcb007072867ae64be8b85a678eacb6161","after":"d457617e86347e74a0cc36b501bf58dfdeb40656","ref":"refs/heads/master","pushedAt":"2023-09-25T12:23:46.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"generalmimon","name":"Petr Pučil","path":"/generalmimon","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/47499687?s=80&v=4"},"commit":{"message":"close(): ensure that all calls to read_bits_int_*() fail after closing\n\nSee https://github.com/kaitai-io/kaitai_struct_java_runtime/commit/feb61fd43e8e3cb4290becf1be84bcb68e4b1185","shortMessageHtmlLink":"close(): ensure that all calls to read_bits_int_*() fail after closing"}},{"before":"704995acdb2f114e15809cf5f469e3a80a2dddad","after":"c0c454bcb007072867ae64be8b85a678eacb6161","ref":"refs/heads/master","pushedAt":"2023-09-25T08:33:19.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"generalmimon","name":"Petr Pučil","path":"/generalmimon","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/47499687?s=80&v=4"},"commit":{"message":"Validation*Error: only include \"at pos X: \" if `io` is not `None`\n\nSee https://github.com/kaitai-io/kaitai_struct_java_runtime/commit/c9842613c1f9f216fee373b5a526968f260e58f9","shortMessageHtmlLink":"Validation*Error: only include \"at pos X: \" if io is not None"}},{"before":"83917311ab0ba0e1a3b021a78f6067b40817b590","after":"704995acdb2f114e15809cf5f469e3a80a2dddad","ref":"refs/heads/master","pushedAt":"2023-07-30T15:21:24.000Z","pushType":"push","commitsCount":16,"pusher":{"login":"GreyCat","name":"Mikhail Yakshin","path":"/GreyCat","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/157154?s=80&v=4"},"commit":{"message":"_write_bytes_not_aligned(): use `self._io.tell()` in EOF check\n\nIn ced78c44, the EOF check used in _write_bytes_not_aligned() was\nchanged to use `self.pos()` instead of `self._io.tell()`, but this\nturned out to be a mistake. Although it doesn't matter in most cases\nbecause it's usually used via the write_bytes() method which aligns the\nstream to a byte boundary first (and `self.pos()` is equivalent to\n`self._io.tell()` on a byte boundary), there are few places where it\ndoes matter.\n\nOne place is the write_align_to_byte() method, where the\nmisinterpretation of `self.pos()` would turn into an observable bug if\nit weren't for the change in 28de847c (which was done for a different\nreason) - we're testing for this bug since\nhttps://github.com/kaitai-io/kaitai_struct_tests/commit/cc36a88b3f4b5ae1473e6cae44b464cfea48ae12.\nAnother place are the actual _write_bytes_not_aligned() calls in the\nwrite_bits_int_{be,le}() methods (even though I think in the current\nimplementation the EOF check inside _write_bytes_not_aligned() will not\nbe triggered).\n\nAll in all, it becomes clear that the EOF check in\n_write_bytes_not_aligned() must not access `bits_left` - it should work\nexclusively with the real byte position of the underlying I/O stream.","shortMessageHtmlLink":"_write_bytes_not_aligned(): use self._io.tell() in EOF check"}},{"before":"28de847ca417439eb143237cbf3b43f5263b014e","after":"704995acdb2f114e15809cf5f469e3a80a2dddad","ref":"refs/heads/serialization","pushedAt":"2023-07-28T14:35:40.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"generalmimon","name":"Petr Pučil","path":"/generalmimon","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/47499687?s=80&v=4"},"commit":{"message":"_write_bytes_not_aligned(): use `self._io.tell()` in EOF check\n\nIn ced78c44, the EOF check used in _write_bytes_not_aligned() was\nchanged to use `self.pos()` instead of `self._io.tell()`, but this\nturned out to be a mistake. Although it doesn't matter in most cases\nbecause it's usually used via the write_bytes() method which aligns the\nstream to a byte boundary first (and `self.pos()` is equivalent to\n`self._io.tell()` on a byte boundary), there are few places where it\ndoes matter.\n\nOne place is the write_align_to_byte() method, where the\nmisinterpretation of `self.pos()` would turn into an observable bug if\nit weren't for the change in 28de847c (which was done for a different\nreason) - we're testing for this bug since\nhttps://github.com/kaitai-io/kaitai_struct_tests/commit/cc36a88b3f4b5ae1473e6cae44b464cfea48ae12.\nAnother place are the actual _write_bytes_not_aligned() calls in the\nwrite_bits_int_{be,le}() methods (even though I think in the current\nimplementation the EOF check inside _write_bytes_not_aligned() will not\nbe triggered).\n\nAll in all, it becomes clear that the EOF check in\n_write_bytes_not_aligned() must not access `bits_left` - it should work\nexclusively with the real byte position of the underlying I/O stream.","shortMessageHtmlLink":"_write_bytes_not_aligned(): use self._io.tell() in EOF check"}},{"before":"ebfae5fb558c839e265f84c986fbf9e22a049bb1","after":"28de847ca417439eb143237cbf3b43f5263b014e","ref":"refs/heads/serialization","pushedAt":"2023-07-22T11:54:35.000Z","pushType":"push","commitsCount":5,"pusher":{"login":"generalmimon","name":"Petr Pučil","path":"/generalmimon","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/47499687?s=80&v=4"},"commit":{"message":"write_align_to_byte(): clear bit buffer even if the write fails","shortMessageHtmlLink":"write_align_to_byte(): clear bit buffer even if the write fails"}},{"before":"b71763c4217370350be3766e23151d3a2fc58689","after":"ebfae5fb558c839e265f84c986fbf9e22a049bb1","ref":"refs/heads/serialization","pushedAt":"2023-03-17T18:18:36.000Z","pushType":"pr_merge","commitsCount":1,"pusher":{"login":"GreyCat","name":"Mikhail Yakshin","path":"/GreyCat","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/157154?s=80&v=4"},"commit":{"message":"Add Python 3.11 tag to setup.cfg (#74)","shortMessageHtmlLink":"Add Python 3.11 tag to setup.cfg (#74)"}},{"before":"a7a4ab1c6e974b0e064d957a863fd056c58ef4d5","after":"b71763c4217370350be3766e23151d3a2fc58689","ref":"refs/heads/serialization","pushedAt":"2023-03-07T10:57:10.324Z","pushType":"push","commitsCount":1,"pusher":{"login":"generalmimon","name":"Petr Pučil","path":"/generalmimon","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/47499687?s=80&v=4"},"commit":{"message":"Bump package version to 0.11.dev1","shortMessageHtmlLink":"Bump package version to 0.11.dev1"}}],"hasNextPage":false,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAAEhsx_BwA","startCursor":null,"endCursor":null}},"title":"Activity · kaitai-io/kaitai_struct_python_runtime"}