Skip to content

jenv init is really slow #148

@ggascoigne

Description

@ggascoigne

I finally got around to trying to work out why my shell startup time was so slow. Turns out that over 70% of the time spent in my .bashrc file is spent executing the eval "$(jenv init -)" line.

$ time eval "$(jenv init -)"

real    0m3.164s
user    0m2.879s
sys 0m0.258s

This seems a bit excessive. I should add that I have a ton of java version installed.

$ jenv versions
  system
  1.6
  1.6.0.65
  1.7
  1.7.0.11
  1.7.0.75
  1.7.0.76
* 1.8 (set by /Users/ggp/.jenv/version)
  1.8.0.20
  1.8.0.25
  1.8.0.31
  1.8.0.40
  1.8.0.45
  1.8.0.51
  1.8.0.60
  1.8.0.65
  1.8.0.66
  1.8.0.71
  1.8.0.72
  1.8.0.73
  1.8.0.74
  1.8.0.77
  1.8.0.91
  1.8.0.92
  oracle64-1.6.0.65
  oracle64-1.7.0.11
  oracle64-1.7.0.67
  oracle64-1.7.0.75
  oracle64-1.7.0.76
  oracle64-1.8.0.20
  oracle64-1.8.0.25
  oracle64-1.8.0.31
  oracle64-1.8.0.40
  oracle64-1.8.0.45
  oracle64-1.8.0.51
  oracle64-1.8.0.60
  oracle64-1.8.0.65
  oracle64-1.8.0.66
  oracle64-1.8.0.71
  oracle64-1.8.0.72
  oracle64-1.8.0.73
  oracle64-1.8.0.74
  oracle64-1.8.0.77
  oracle64-1.8.0.91
  oracle64-1.8.0.92

Bash version is:

$ bash --version
GNU bash, version 4.3.42(1)-release (x86_64-apple-darwin14.5.0)
Copyright (C) 2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions