JuliaCollections / JuliaCollections/DataStructures.jl

Lt still slow?

Open
#244 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
745
Forks
261
PR merge metrics
No merged PRs in 30d

Description

See below for some text from the datastructures.jl documentation (which I wrote last year). I'm wondering whether the statement about the performance hit from using Lt rather than a customized order type is still accurate for 0.5 and 0.6, in which the type system for functions has been revamped. I can try some performance tests if the consensus is that the current documentation is inaccurate.

A second minor documentation issue is that the entry in the table of contents for the sorted containers should probably be "Sorted containers" rather than "Overview of sorted containers".

Thanks,
Steve

---- quote from the documentation begins here

The simplest approach is to define an ordering object of the form Lt(my_isless), where Lt is a built-in type (see ordering.jl) and my_isless is the user’s comparison function. In the above example, the ordering object would be:

  Lt((x,y) -> isless(lowercase(x),lowercase(y)))

The ordering object is indicated in the above list of constructors in the o position (see above for constructor syntax).

This approach suffers from a performance hit (10%-50% depending on the container) because the compiler cannot inline or compute the correct dispatch for the function in parentheses, so the dispatch takes place at run-time.

Contributor guide

No contributing guide indexed for this repository

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 with the datastructures.jl documentation and ordering.jl, then verify whether the stated performance hit for Lt remains accurate in Julia 0.5 and 0.6. Use performance tests to confirm the documentation claim, and check the sorted containers table-of-contents entry. Done means the performance wording reflects the results and the entry is renamed if appropriate.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
documentation, performance
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.