# TensorKit efficiency

**URL:** <https://discourse.julialang.org/t/tensorkit-efficiency/59559>\
**Category:** Numerics\
**Tags:** tensors\
**Created:** [April 18, 2021, 7:33pm UTC](https://discourse.julialang.org/t/tensorkit-efficiency/59559 "2021-04-18T19:33:34Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Nellatur](https://avatars.discourse-cdn.com/v4/letter/n/76d3ee/32.png) [@Nellatur](https://discourse.julialang.org/u/Nellatur)\
**Post date:** [April 18, 2021, 9:13pm UTC](https://discourse.julialang.org/t/tensorkit-efficiency/59559/6 "2021-04-18T21:13:35Z")

</div>

Thanks for your suggestion and sample code.

Indeed, the `@time tensorkit_contraction(A,B,C)` leads to \>99% compilation time. If I rerun this function 2nd time in the same input file, the time will get much smaller. It seems @time includes overhead time [@time vs @btime](https://discourse.julialang.org/t/time-vs-btime/9879)

If I am permitted to reuse my stupid code,

```julia
function tensorkit_contraction(A,B,C)
  @time begin
    @tensor C[a,c,d] := A[a,b] * B[b,c,d]
  end
 # print(C[1,2,3])
end 

@time tensorkit_contraction(A,B,C)

@btime tensorkit_contraction(A,B,C)

```

I got `ERROR: LoadError: LoadError: UndefVarError: @btime not defined`. May I know, why I got `@btime not defined` error message?

---

_[View the full topic](https://discourse.julialang.org/t/tensorkit-efficiency/59559)._
