We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
getfield would be more efficient than eval in getting the value of a variable/function name here:
getfield
eval
TextAnalysis.jl/src/tagging_schemes.jl
Lines 50 to 51 in dd67dcf
Toy example:
julia> using BenchmarkTools julia> foo = 42 42 julia> @btime eval(Symbol("foo")) 44.230 ns (0 allocations: 0 bytes) 42 julia> @btime getfield(Main, Symbol("foo")) 1.180 ns (0 allocations: 0 bytes) 42
The text was updated successfully, but these errors were encountered:
Thanks, yes, this code if probably from before getfield existed. I'd be grateful for a PR.
Sorry, something went wrong.
Ok, will do :)
fixed in 5778129
Successfully merging a pull request may close this issue.
getfield
would be more efficient thaneval
in getting the value of a variable/function name here:TextAnalysis.jl/src/tagging_schemes.jl
Lines 50 to 51 in dd67dcf
Toy example:
The text was updated successfully, but these errors were encountered: