-
Notifications
You must be signed in to change notification settings - Fork 15.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ruby: Add size to RepeatField #328
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
|
||
#add syntatic sugar on top of the core library |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tiny nitpick: space between the #
start of comment and the comment text?
related to #320 |
Looks good; could you squash to a single commit? Thanks! |
np! |
starting to make `RepeatedField` quack like an array additional changes: * make sure gemspec gets all ruby code files * add homepage in gem spec removes one of the warnings, and the gem spec authors are pushing everyone to include a homepage in the gem * remove excess whitespace in test suite to bring formatting inline with the rest of the file
Thanks, merging. |
bithium
pushed a commit
to bithium/protobuf
that referenced
this pull request
Sep 4, 2023
Optimized the loading of descriptors
copybara-service bot
pushed a commit
that referenced
this pull request
Dec 14, 2023
Before, every charAt would emit (on android): ``` 0x00002104 adrp x17, #+0x1000 (addr 0x3000) 0x00002108 ldr w17, [x17, #20] 0x0000210c ldr x0, [x0, #128] 0x00002110 ldr x0, [x0, #328] 0x00002114 ldr lr, [x0, #24] 0x00002118 blr lr <-- Call into String.charAt(int) ``` Now, it emits the inlined implementation of charAt (branch is for possibly compressed strings): ``` 0x000020b4 ldur w16, [x4, #-8] 0x000020b8 tbnz w16, #0, #+0xc (addr 0x20c4) 0x000020bc ldrb w4, [x4, x0] 0x000020c0 b #+0x8 (addr 0x20c8) 0x000020c4 ldrh w4, [x4, x0, lsl #1] ``` PiperOrigin-RevId: 590821750
copybara-service bot
pushed a commit
that referenced
this pull request
Dec 15, 2023
Before, every charAt would emit (on android): ``` 0x00002104 adrp x17, #+0x1000 (addr 0x3000) 0x00002108 ldr w17, [x17, #20] 0x0000210c ldr x0, [x0, #128] 0x00002110 ldr x0, [x0, #328] 0x00002114 ldr lr, [x0, #24] 0x00002118 blr lr <-- Call into String.charAt(int) ``` Now, it emits the inlined implementation of charAt (branch is for possibly compressed strings): ``` 0x000020b4 ldur w16, [x4, #-8] 0x000020b8 tbnz w16, #0, #+0xc (addr 0x20c4) 0x000020bc ldrb w4, [x4, x0] 0x000020c0 b #+0x8 (addr 0x20c8) 0x000020c4 ldrh w4, [x4, x0, lsl #1] ``` PiperOrigin-RevId: 590821750
copybara-service bot
pushed a commit
that referenced
this pull request
Dec 15, 2023
Before, every charAt would emit (on android): ``` 0x00002104 adrp x17, #+0x1000 (addr 0x3000) 0x00002108 ldr w17, [x17, #20] 0x0000210c ldr x0, [x0, #128] 0x00002110 ldr x0, [x0, #328] 0x00002114 ldr lr, [x0, #24] 0x00002118 blr lr <-- Call into String.charAt(int) ``` Now, it emits the inlined implementation of charAt (branch is for possibly compressed strings): ``` 0x000020b4 ldur w16, [x4, #-8] 0x000020b8 tbnz w16, #0, #+0xc (addr 0x20c4) 0x000020bc ldrb w4, [x4, x0] 0x000020c0 b #+0x8 (addr 0x20c8) 0x000020c4 ldrh w4, [x4, x0, lsl #1] ``` PiperOrigin-RevId: 591147406
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
initial steps to make RepeatedField act more like a ruby Array
Let me know if this approach of aliasing and adding syntactic sugar in the ruby lib, rather than duplicating the logic in C and Java, is acceptable.