Skip to content

cast::transmute shows up in profiles #6925

Closed
@jdm

Description

@jdm

Even though cast::transmute is inlined, apparently the rusti::transmute intrinsic is not. Perf shows this annotated view:

       │    0000000000088dd0 <cast::transmute_9885::_c97de6de549dd4c9::_07pre>:
  4.56 │      cmp    %fs:0x70,%rsp
       │    ↓ ja     25
       │      movabs $0x28,%r10
       │      movabs $0x0,%r11
       │    → callq  __morestack
       │    ← retq
 14.10 │25:   push   %rbp
  0.43 │      mov    %rsp,%rbp
  2.17 │      sub    $0x20,%rsp
  2.82 │      mov    %rdx,-0x20(%rbp)
  1.95 │    ↓ jmp    3d
       │33:   mov    -0x8(%rbp),%rax
 24.30 │      add    $0x20,%rsp
  0.22 │      pop    %rbp
  0.22 │    ← retq
  0.22 │3d:   mov    -0x20(%rbp),%rax
  8.68 │      mov    %rax,-0x10(%rbp)
  4.12 │      mov    -0x10(%rbp),%rax
 10.63 │      mov    %rax,-0x18(%rbp)
  1.30 │      mov    -0x18(%rbp),%rdx
 15.40 │    → callq  cast::rusti::transmute_9888::_a9e57e9b33a18c23::_07pre
       │      mov    %rax,-0x8(%rbp)
  8.89 │    ↑ jmp    33

This is showing up in servo profiles.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationI-slowIssue: Problems and improvements with respect to performance of generated code.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions