Skip to content
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

Opaque robj: add objectGetVal and remove ~80% of all robj->ptr refs #1658

Open
wants to merge 2 commits into
base: unstable
Choose a base branch
from

Conversation

SoftlyRaining
Copy link
Contributor

I wanted to know if I could do this quickly by writing some scripts. It probably took twice as long as I thought, but only 3 hours so not terrible, and now I know. 🤷🏻‍♀️ Total number of references goes from ~400 to ~80, and all remaining references assign a value to robj->ptr. Those can be addressed in a separate PR, this one is big enough.

I know we want to make robj opaque so it's easier to refactor it or change its internal structure. I thought there was an issue for this but I can't find it offhand.

Copy link

codecov bot commented Feb 3, 2025

Codecov Report

Attention: Patch coverage is 83.67514% with 199 lines in your changes missing coverage. Please review.

Project coverage is 70.86%. Comparing base (78bcc0a) to head (634f526).
Report is 4 commits behind head on unstable.

Files with missing lines Patch % Lines
src/sentinel.c 0.00% 73 Missing ⚠️
src/module.c 1.92% 51 Missing ⚠️
src/debug.c 78.26% 20 Missing ⚠️
src/object.c 83.11% 13 Missing ⚠️
src/t_list.c 90.56% 5 Missing ⚠️
src/cluster_legacy.c 88.23% 4 Missing ⚠️
src/replication.c 89.74% 4 Missing ⚠️
src/t_stream.c 94.44% 4 Missing ⚠️
src/db.c 95.83% 3 Missing ⚠️
src/memory_prefetch.c 0.00% 3 Missing ⚠️
... and 13 more
Additional details and impacted files
@@             Coverage Diff              @@
##           unstable    #1658      +/-   ##
============================================
- Coverage     71.02%   70.86%   -0.17%     
============================================
  Files           121      121              
  Lines         65176    65206      +30     
============================================
- Hits          46290    46206      -84     
- Misses        18886    19000     +114     
Files with missing lines Coverage Δ
src/bitops.c 93.77% <100.00%> (+0.30%) ⬆️
src/cluster_slot_stats.c 94.35% <100.00%> (ø)
src/commandlog.c 96.58% <100.00%> (ø)
src/config.c 78.40% <100.00%> (+0.01%) ⬆️
src/eval.c 57.06% <100.00%> (ø)
src/expire.c 96.59% <100.00%> (ø)
src/functions.c 94.50% <100.00%> (ø)
src/geo.c 93.58% <100.00%> (ø)
src/lazyfree.c 86.11% <100.00%> (ø)
src/multi.c 97.30% <100.00%> (ø)
... and 32 more

... and 5 files with indirect coverage changes

@zuiderkwast
Copy link
Contributor

Awesome! Tbh, I'd prefer the complete change in one PR so we can get the benefit in memory usage. A separate commit within the same PR for the assignments and then a final commit to actually save memory in the object struct.

Feel free to write down you regexes so we can review those instead of alongside the actual diff. :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants