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

Made types parameterized to avoid having abstract types as fields #23

Closed
wants to merge 1 commit into from
Closed

Made types parameterized to avoid having abstract types as fields #23

wants to merge 1 commit into from

Conversation

phaverty
Copy link
Contributor

@phaverty phaverty commented Oct 3, 2015

Inspired by #19 this PR makes the types parameterized, which avoids the performance problem associated with abstract field types.

@carlobaldassi
Copy link
Owner

Tests are failing.
Anyway, I don't think the performance gains of avoiding abstract field types would be noticeable. Given the intended usage of this package, the biggest bottleneck is still precompilation (currently blocked by JuliaAttic/Options.jl#4). When that is solved somehow, I frankly don't see performance as critical for this package (i.e. it's nice to have, but not at the cost of reducing flexibility for tiny gains). It's a package which is loaded and used only once, when you start julia, and it doesn't need to do any particularly heavy task.
(If there are examples to the contrary, please share them.)

@carlobaldassi
Copy link
Owner

Just to provide some numbers: I have been experimenting and trying to determine the relative timings in executing the first example in the examples directory. I even precompiled every dependency (including Options, which I renamed just for this) and all functions called by all modules (using the fantastic SnoopCompile.jl package by @timholy). This improves the overall performance considerably (about 3x) and only leaves out methods from Base which still need to be compiled. Still, the timings when running the main function look like this:

  • first execution: 1.065924 seconds
  • later executions: 0.000382 seconds

so without precompiling every function, including the ones in Base, there is absolutely no point in addressing any other performance issue. And even then the julia starting time (about 0.2s) still overwhelms anything ArgParse may be doing.
(Precompiling things from Base requires to recompile julia from source.)

@phaverty
Copy link
Contributor Author

phaverty commented Oct 3, 2015

True enough. Startup time is clearly the bottleneck. The other stuff may eventually matter.
I've been experimenting with porting some of my perl utilities to Julia. Julia has some great facilities for basic shell tasks, but until Julia's startup and package loading are instant, perl will still have a job.

I believe the Julia crew want to get there, both with Julia as a scripting/glue language and startup time. The recent advances with pre-compilation are wonderful.

Maybe a better course of action is to get rid of all the dependencies and their loading time. Options is on the way out I gather, but maybe they can all go.

@phaverty phaverty deleted the pull-request/b8525b69 branch October 3, 2015 20:28
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.

2 participants