Skip to content

Instantly share code, notes, and snippets.

@james7132
Created November 4, 2022 02:30
Show Gist options
  • Save james7132/c2740c6941b80d7912f1e8888e223cbb to your computer and use it in GitHub Desktop.
Save james7132/c2740c6941b80d7912f1e8888e223cbb to your computer and use it in GitHub Desktop.
Inefficient Query iteration
.text
.def @feat.00;
.scl 3;
.type 0;
.endef
.globl @feat.00
.set @feat.00, 0
.file "empty.2eb308ba-cgu.0"
.def _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17hbaba4511104e15d0E;
.scl 3;
.type 32;
.endef
.section .text,"xr",one_only,_ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17hbaba4511104e15d0E
.p2align 4, 0x90
_ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17hbaba4511104e15d0E:
.seh_proc _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17hbaba4511104e15d0E
subq $40, %rsp
.seh_stackalloc 40
.seh_endprologue
callq *%rcx
#APP
#NO_APP
nop
addq $40, %rsp
retq
.seh_endproc
.def _ZN3std2rt10lang_start17hb9c91ac9dd6ed46fE;
.scl 2;
.type 32;
.endef
.section .text,"xr",one_only,_ZN3std2rt10lang_start17hb9c91ac9dd6ed46fE
.globl _ZN3std2rt10lang_start17hb9c91ac9dd6ed46fE
.p2align 4, 0x90
_ZN3std2rt10lang_start17hb9c91ac9dd6ed46fE:
.seh_proc _ZN3std2rt10lang_start17hb9c91ac9dd6ed46fE
subq $56, %rsp
.seh_stackalloc 56
.seh_endprologue
movq %r8, %rax
movq %rdx, %r8
movq %rcx, 48(%rsp)
movb %r9b, 32(%rsp)
leaq __unnamed_1(%rip), %rdx
leaq 48(%rsp), %rcx
movq %rax, %r9
callq _ZN3std2rt19lang_start_internal17h9b461f8940399158E
nop
addq $56, %rsp
retq
.seh_endproc
.def _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17hffef15e246a4f59aE;
.scl 3;
.type 32;
.endef
.section .text,"xr",one_only,_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17hffef15e246a4f59aE
.p2align 4, 0x90
_ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17hffef15e246a4f59aE:
.seh_proc _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17hffef15e246a4f59aE
subq $40, %rsp
.seh_stackalloc 40
.seh_endprologue
movq (%rcx), %rcx
callq _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17hbaba4511104e15d0E
xorl %eax, %eax
addq $40, %rsp
retq
.seh_endproc
.def _ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h94148165bc603fecE;
.scl 3;
.type 32;
.endef
.section .text,"xr",one_only,_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h94148165bc603fecE
.p2align 4, 0x90
_ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h94148165bc603fecE:
.seh_proc _ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h94148165bc603fecE
subq $40, %rsp
.seh_stackalloc 40
.seh_endprologue
movq (%rcx), %rcx
callq _ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17hbaba4511104e15d0E
xorl %eax, %eax
addq $40, %rsp
retq
.seh_endproc
.def _ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h18cd7ed705c9a785E;
.scl 3;
.type 32;
.endef
.section .text,"xr",one_only,_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h18cd7ed705c9a785E
.p2align 4, 0x90
_ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h18cd7ed705c9a785E:
retq
.def iter;
.scl 2;
.type 32;
.endef
.section .text,"xr",one_only,iter
.globl iter
.p2align 4, 0x90
iter:
.seh_proc iter
pushq %r15
.seh_pushreg %r15
pushq %r14
.seh_pushreg %r14
pushq %r12
.seh_pushreg %r12
pushq %rsi
.seh_pushreg %rsi
pushq %rdi
.seh_pushreg %rdi
pushq %rbp
.seh_pushreg %rbp
pushq %rbx
.seh_pushreg %rbx
subq $32, %rsp
.seh_stackalloc 32
.seh_endprologue
movq (%rcx), %r15
movq 8(%rcx), %r12
movl 16(%rcx), %r8d
movl 20(%rcx), %r14d
leaq 352(%r12), %rdx
movq %r15, %rcx
movl %r14d, %r9d
callq _ZN63_$LT$$LP$$RP$$u20$as$u20$bevy_ecs..query..fetch..WorldQuery$GT$10init_fetch17h73b66975c92fda3bE
movq 288(%r12), %r11
movq 304(%r12), %rax
leaq (%r11,%rax,8), %r10
xorl %edx, %edx
xorl %r9d, %r9d
xorl %ecx, %ecx
xorl %ebp, %ebp
cmpq %rcx, %rbp
jne .LBB5_2
.p2align 4, 0x90
.LBB5_5:
cmpq %r10, %r11
je .LBB5_15
movq (%r11), %rcx
movq 328(%r15), %rdx
cmpq %rdx, %rcx
jae .LBB5_14
movq 312(%r15), %rdi
leaq (%rcx,%rcx,2), %rcx
shlq $5, %rcx
movq 336(%r12), %rdx
movq 64(%rdi,%rcx), %rax
cmpq %rdx, %rax
jbe .LBB5_4
leaq (%rdi,%rcx), %rsi
movq 48(%rsi), %rbp
shlq $4, %rdx
cmpq $0, (%rbp,%rdx)
je .LBB5_4
movq 344(%r12), %rbx
cmpq %rbx, %rax
jbe .LBB5_4
shlq $4, %rbx
cmpq $0, (%rbp,%rbx)
je .LBB5_4
addq $8, %r11
movq 88(%rdi,%rcx), %rcx
testq %rcx, %rcx
je .LBB5_5
movq (%rsi), %rax
movq 8(%rbp,%rdx), %rdx
leaq (%rdx,%rdx,4), %rdi
shlq $4, %rdi
movq 32(%rax,%rdi), %rdx
movq 56(%rax,%rdi), %r8
movq 8(%rbp,%rbx), %rbp
leaq (%rbp,%rbp,4), %rbp
shlq $4, %rbp
movq 32(%rax,%rbp), %r9
xorl %ebp, %ebp
jmp .LBB5_13
.p2align 4, 0x90
.LBB5_2:
testq %rdx, %rdx
je .LBB5_4
testq %r9, %r9
je .LBB5_4
.LBB5_13:
movss (%r9,%rbp,4), %xmm0
movl %r14d, 4(%r8,%rbp,8)
addss (%rdx,%rbp,4), %xmm0
movss %xmm0, (%rdx,%rbp,4)
incq %rbp
cmpq %rcx, %rbp
je .LBB5_5
jmp .LBB5_2
.LBB5_15:
addq $32, %rsp
popq %rbx
popq %rbp
popq %rdi
popq %rsi
popq %r12
popq %r14
popq %r15
retq
.LBB5_14:
leaq __unnamed_2(%rip), %r8
callq _ZN4core9panicking18panic_bounds_check17h70367088e72af65aE
ud2
.LBB5_4:
callq _ZN8bevy_ecs5query25debug_checked_unreachable17h0855ff520ceaea77E
ud2
.seh_endproc
.def _ZN5empty4main17h972511f3bfbba126E;
.scl 3;
.type 32;
.endef
.section .text,"xr",one_only,_ZN5empty4main17h972511f3bfbba126E
.p2align 4, 0x90
_ZN5empty4main17h972511f3bfbba126E:
retq
.def main;
.scl 2;
.type 32;
.endef
.section .text,"xr",one_only,main
.globl main
.p2align 4, 0x90
main:
.seh_proc main
subq $56, %rsp
.seh_stackalloc 56
.seh_endprologue
movq %rdx, %r9
movslq %ecx, %r8
leaq _ZN5empty4main17h972511f3bfbba126E(%rip), %rax
movq %rax, 48(%rsp)
movb $2, 32(%rsp)
leaq __unnamed_1(%rip), %rdx
leaq 48(%rsp), %rcx
callq _ZN3std2rt19lang_start_internal17h9b461f8940399158E
nop
addq $56, %rsp
retq
.seh_endproc
.section .rdata,"dr",one_only,__unnamed_1
.p2align 3
__unnamed_1:
.quad _ZN4core3ptr85drop_in_place$LT$std..rt..lang_start$LT$$LP$$RP$$GT$..$u7b$$u7b$closure$u7d$$u7d$$GT$17h18cd7ed705c9a785E
.asciz "\b\000\000\000\000\000\000\000\b\000\000\000\000\000\000"
.quad _ZN4core3ops8function6FnOnce40call_once$u7b$$u7b$vtable.shim$u7d$$u7d$17h94148165bc603fecE
.quad _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17hffef15e246a4f59aE
.quad _ZN3std2rt10lang_start28_$u7b$$u7b$closure$u7d$$u7d$17hffef15e246a4f59aE
.section .rdata,"dr",one_only,__unnamed_3
__unnamed_3:
.ascii "examples/app/empty.rs"
.section .rdata,"dr",one_only,__unnamed_2
.p2align 3
__unnamed_2:
.quad __unnamed_3
.asciz "\025\000\000\000\000\000\000\000\r\000\000\000\027\000\000"
.globl _fltused
use bevy::prelude::*;
#[derive(Component)]
pub struct TestA(f32);
#[derive(Component)]
pub struct TestB(f32);
#[no_mangle]
fn iter(mut query: Query<(&mut TestA, &TestB)>) {
for (mut a, b) in query.iter_mut() {
a.0 += b.0;
}
}
fn main() {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment