Skip to content
New issue

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

[WIP] More generalindexing [3] #15679

Merged
merged 3 commits into from
Apr 5, 2016
Merged

Conversation

dfdx
Copy link
Contributor

@dfdx dfdx commented Mar 29, 2016

One more step towards filling up this list, this time from markdown/* to regex.jl.

This is marked as WIP since there's a number of discussable changes (see fixme (iter) comments with question mark) for which I'd be happy to get comments. Given previous PRs, I also suggest not to merge these changes until at least 2 pairs of eyes don't check it out.

Also I couldn't find any "standard" performance tests, but it would be very nice to make sure the PR doesn't introduce any performance regression. I hope folks here can run such tests or point me to a proper way to do it.


I skipped several files for particular reasons described below. Please, take another look at them if you believe we can improve them further. The files are:

  • markdown/GitHub/table.jl

Works on cells with unspecified type. Seems to expect array of arrays, but no guarantee of consistency. Anyway, looks like internal stuff so unlikely to change default array format.

  • pkg/resolve/maxsum.jl
  • pkg/resolve/maxsum.jl

All loops over internal data structures (e.g. Messages, Field, etc), considered unlikely to change.

  • primes.jl

Direct comment not to use eachindex there :)

  • profile.jl

for i=1:length(V) where V is a Vector, so equivalent to eachindex anyway.

cc: @timholy @nalimilan @KristofferC

@@ -1544,13 +1544,13 @@ function pmap(f, lsts...; err_retry=true, err_stop=false, pids = workers())
nextidx = 0
getnextidx() = (nextidx += 1)

states = [start(lsts[idx]) for idx in 1:len]
states = [start(lst) for lst in lsts]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even shorter: map(start, lsts).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Surprisingly, changing it to map(start, lsts) leads to an error in tests (see log). I will change it to the original code, but it may uncover some other issue.

@@ -1544,7 +1544,7 @@ function pmap(f, lsts...; err_retry=true, err_stop=false, pids = workers())
nextidx = 0
getnextidx() = (nextidx += 1)

states = [start(lsts[idx]) for idx in 1:len]
states = map(start, lsts)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One risk with using map here is that you can't guarantee that states is an array. For example, if lsts is a tuple, then states will be a tuple, and the later line that sets states[i] = ... will fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, reverting it to the original code fixes the error (at least locally).

@timholy
Copy link
Member

timholy commented Mar 31, 2016

Mostly looks good. I noticed there's a travis error; might be related to the point about map I raised above.

@dfdx
Copy link
Contributor Author

dfdx commented Apr 2, 2016

@timholy Do you have any suggestions about how to do performance testing for this PR?

@timholy
Copy link
Member

timholy commented Apr 3, 2016

Performance regressions seem very unlikely here, but lets runbenchmarks("ALL", vs = "JuliaLang/julia:master").

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed, but no benchmarks were actually executed. Perhaps your tag predicate contains mispelled tags? cc @jrevels

@jrevels
Copy link
Member

jrevels commented Apr 4, 2016

ALL is a keyword, not a tag, so it doesn't get the quotes: runbenchmarks(ALL, vs = "JuliaLang/julia:master")

@timholy
Copy link
Member

timholy commented Apr 4, 2016

Thanks, Jarrett.

@nanosoldier
Copy link
Collaborator

Your benchmark job has completed - possible performance regressions were detected. A full report can be found here. cc @jrevels

@timholy timholy merged commit db2c6ab into JuliaLang:master Apr 5, 2016
@timholy
Copy link
Member

timholy commented Apr 5, 2016

Looks good, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants