queryverse / queryverse/Query.jl

Eval can be replaced by getfield in select

Open
#322 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Julia
Stars
403
Forks
48
Avg merge
3d 6h
Merged PRs (30d)
6

Description

getfield would be more efficient than eval in getting the value of a variable/type here:

https://github.com/queryverse/Query.jl/blob/a4c0ea1e18227d0495a5bd764e7fae4328a56113/src/table_query_macros.jl#L75

Toy example:

julia> using BenchmarkTools

julia> @btime getfield(Main, Symbol("Int"))
  0.015 ns (0 allocations: 0 bytes)
Int64

julia> @btime eval(Symbol("Int"))
  58.841 ns (0 allocations: 0 bytes)
Int64

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at src/table_query_macros.jl around line 75, where select currently uses eval, and compare it with the getfield lookup shown in the issue. Replace the slower lookup while preserving the existing result, then use the provided Julia benchmark example to verify the lookup is more efficient.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
data, performance
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.