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

Regression in task switching performance? #12223

Closed
amitmurthy opened this issue Jul 20, 2015 · 5 comments
Closed

Regression in task switching performance? #12223

amitmurthy opened this issue Jul 20, 2015 · 5 comments
Labels
performance Must go faster potential benchmark Could make a good benchmark in BaseBenchmarks regression Regression in behavior compared to a previous version

Comments

@amitmurthy
Copy link
Contributor

Current:

  | | |_| | | | (_| |  |  Version 0.4.0-dev+6093 (2015-07-20 07:55 UTC)
 _/ |\__'_|_|_|\__'_|  |  Commit 4ebdea0 (0 days old master)
|__/                   |  x86_64-linux-gnu

julia> function foo(t::Task)
                  while true
                      consume(t)
                  end
              end
foo (generic function with 1 method)

julia> function foon(n)
                  self = current_task()
                  @schedule foo(self)
                  for i in 1:10^n
                      produce(i)
                  end
              end
foon (generic function with 1 method)

julia> foon(1)

julia> @time foon(6)
   6.566 seconds      (2005 k allocations: 31484 KB, 0.11% gc time)

The same test here #12042 (comment)
took 2.291 seconds on my machine. Granted that was on a different branch rebased around 7 days ago, but that branch did not touch any of the task code either.

@amitmurthy amitmurthy added performance Must go faster regression Regression in behavior compared to a previous version labels Jul 20, 2015
@JeffBezanson
Copy link
Member

The regression appears to be in produce/consume. If you just use yieldto instead, I get on 0.3:

julia> function foo(t::Task)
                         while true
                             yieldto(t)
                         end
                     end

julia> function foon(n)
                         self = current_task()
                         tt = @schedule foo(self)
                         for i in 1:10^n
                             yieldto(tt)
                         end
                     end

julia> @time foon(6)
elapsed time: 0.544151055 seconds (1136 bytes allocated)

and on 0.4:

julia> @time foon(6)
 445.107 milliseconds (0 allocations: 1488 bytes)

It is actually a bit faster. But I see the same regression in produce/consume.

@amitmurthy
Copy link
Contributor Author

OK. Here is a funny thing.

Rebooting my machine got back the previous performance on master. I don't know if it is a Linux issue or a Julia thing. I noticed that Julia startup also seemed slow and rebooted.

@amitmurthy
Copy link
Contributor Author

Found the cause. After a couple of make it had slowed down again. A make clean; make fixed it. I don't know how rebooting improved Julia's startup time and the above timings.

@JeffBezanson
Copy link
Member

Wow that's weird, the same thing happened to me. Rebuilt and the performance went back to 0.3 levels. Maybe we were running debug builds?

@amitmurthy
Copy link
Contributor Author

Could that explain the performance boost after a reboot also ? Don't know how...

@jrevels jrevels added the potential benchmark Could make a good benchmark in BaseBenchmarks label Nov 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Must go faster potential benchmark Could make a good benchmark in BaseBenchmarks regression Regression in behavior compared to a previous version
Projects
None yet
Development

No branches or pull requests

3 participants