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

Add cache for source line #4129

Merged
merged 5 commits into from
Jan 20, 2024
Merged

Add cache for source line #4129

merged 5 commits into from
Jan 20, 2024

Conversation

imbillow
Copy link
Contributor

Your checklist for this pull request

  • I've read the guidelines for contributing to this repository
  • I made sure to follow the project's coding style
  • I've documented or updated the documentation of every function and struct this PR changes. If not so I've explained why.
  • I've added tests that prove my fix is effective or that my feature works (if possible)
  • I've updated the rizin book with the relevant information (if needed)

Detailed description

...

Test plan

...

Closing issues

closes #4126

XVilka

This comment was marked as resolved.

@imbillow
Copy link
Contributor Author


FAILED: librz/core/librz_core.so.0.7.0.p/disasm.c.o 

clang -Ilibrz/core/librz_core.so.0.7.0.p -I. -I.. -Ilibrz -I../librz -Ilibrz/include -I../librz/include -Ilibrz/core/cmd_descs -I../librz/core/cmd_descs -Ilibrz/util/sdb/src -I../librz/util/sdb/src -I../librz/asm/arch/include -I../librz/asm/arch -I../librz/asm/arch/h8300 -I../librz/asm/arch/hexagon -I../librz/asm/arch/msp430 -I../librz/asm/arch/rsp -I../librz/asm/arch/mcore -I../librz/asm/arch/v850 -I../librz/asm/arch/propeller -I../librz/asm/arch/ebc -I../librz/asm/arch/cr16 -I../librz/asm/arch/8051 -I../librz/asm/arch/v810 -I../librz/asm/arch/or1k -I../librz/asm/arch/tricore -I../librz/analysis/arch/gb -I../librz/type/parser -I../librz/bin/format/elf -I../librz/bin/format/dmp -I../librz/bin/format/mdmp -I../librz/bin/format/pe -I../librz/bin/format -I../subprojects/rzgdb/include -I../subprojects/rzgdb/include/gdbclient -I../subprojects/rzgdb/include/gdbserver -Isubprojects/rzheap -I../subprojects/rzheap -I../subprojects/rzheap/rz_jemalloc -I../subprojects/rzheap/rz_windows -I../subprojects/rizin-shell-parser/src/tree_sitter -I../subprojects/tree-sitter-0.20.7/lib/src -I../subprojects/tree-sitter-0.20.7/lib/include -fdiagnostics-color=always -fsanitize=address,undefined -fno-omit-frame-pointer -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -O2 -g -DRZ_PLUGIN_INCORE=1 -D_GNU_SOURCE --std=gnu99 -Werror=sizeof-pointer-memaccess -fvisibility=hidden -shared-libasan -DASAN=1 -DRZ_ASSERT_STDOUT=1 -Wno-cpp -fPIC -MD -MQ librz/core/librz_core.so.0.7.0.p/disasm.c.o -MF librz/core/librz_core.so.0.7.0.p/disasm.c.o.d -o librz/core/librz_core.so.0.7.0.p/disasm.c.o -c ../librz/core/disasm.c

../librz/core/disasm.c:275:20: error: unused function 'set_flag' [-Werror,-Wunused-function]

static inline void set_flag(uint32_t *flags, uint32_t flag, bool value) {

                   ^

1 error generated.

Can you please test to see if there's been a performance increase? On my end, I feel like the increase is smaller than expected.

@XVilka
Copy link
Member

XVilka commented Jan 19, 2024


FAILED: librz/core/librz_core.so.0.7.0.p/disasm.c.o 

clang -Ilibrz/core/librz_core.so.0.7.0.p -I. -I.. -Ilibrz -I../librz -Ilibrz/include -I../librz/include -Ilibrz/core/cmd_descs -I../librz/core/cmd_descs -Ilibrz/util/sdb/src -I../librz/util/sdb/src -I../librz/asm/arch/include -I../librz/asm/arch -I../librz/asm/arch/h8300 -I../librz/asm/arch/hexagon -I../librz/asm/arch/msp430 -I../librz/asm/arch/rsp -I../librz/asm/arch/mcore -I../librz/asm/arch/v850 -I../librz/asm/arch/propeller -I../librz/asm/arch/ebc -I../librz/asm/arch/cr16 -I../librz/asm/arch/8051 -I../librz/asm/arch/v810 -I../librz/asm/arch/or1k -I../librz/asm/arch/tricore -I../librz/analysis/arch/gb -I../librz/type/parser -I../librz/bin/format/elf -I../librz/bin/format/dmp -I../librz/bin/format/mdmp -I../librz/bin/format/pe -I../librz/bin/format -I../subprojects/rzgdb/include -I../subprojects/rzgdb/include/gdbclient -I../subprojects/rzgdb/include/gdbserver -Isubprojects/rzheap -I../subprojects/rzheap -I../subprojects/rzheap/rz_jemalloc -I../subprojects/rzheap/rz_windows -I../subprojects/rizin-shell-parser/src/tree_sitter -I../subprojects/tree-sitter-0.20.7/lib/src -I../subprojects/tree-sitter-0.20.7/lib/include -fdiagnostics-color=always -fsanitize=address,undefined -fno-omit-frame-pointer -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Werror -O2 -g -DRZ_PLUGIN_INCORE=1 -D_GNU_SOURCE --std=gnu99 -Werror=sizeof-pointer-memaccess -fvisibility=hidden -shared-libasan -DASAN=1 -DRZ_ASSERT_STDOUT=1 -Wno-cpp -fPIC -MD -MQ librz/core/librz_core.so.0.7.0.p/disasm.c.o -MF librz/core/librz_core.so.0.7.0.p/disasm.c.o.d -o librz/core/librz_core.so.0.7.0.p/disasm.c.o -c ../librz/core/disasm.c

../librz/core/disasm.c:275:20: error: unused function 'set_flag' [-Werror,-Wunused-function]

static inline void set_flag(uint32_t *flags, uint32_t flag, bool value) {

                   ^

1 error generated.

Can you please test to see if there's been a performance increase? On my end, I feel like the increase is smaller than expected.

Yes, I confirm. It's much faster than before even though it's not ideal and still somewhat slow. I think the current increase is around 3x times faster.

librz/main/rz-bin.c Outdated Show resolved Hide resolved
librz/bin/dbginfo.c Outdated Show resolved Hide resolved
test/db/tools/rz_bin Show resolved Hide resolved
XVilka

This comment was marked as resolved.

Copy link
Member

@XVilka XVilka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Retested again - now it's in the category of being usable again. We can further optimize this in the future after careful profiling. Meanwhile, good job! 👍

Also a first step towards solving #907

@XVilka XVilka merged commit 88f6c78 into dev Jan 20, 2024
46 of 47 checks passed
@XVilka XVilka deleted the cache-source-line branch January 20, 2024 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Very slow disassembly speed on some files
2 participants