Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #39016 > unrolled thread

Starting jshell takes about 15 seconds

Started byCecil Westerhof <Cecil@decebal.nl>
First post2019-07-28 18:04 +0200
Last post2019-08-01 21:03 -0400
Articles 7 — 3 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Starting jshell takes about 15 seconds Cecil Westerhof <Cecil@decebal.nl> - 2019-07-28 18:04 +0200
    Re: Starting jshell takes about 15 seconds Arne Vajhøj <arne@vajhoej.dk> - 2019-07-28 19:56 -0400
      Re: Starting jshell takes about 15 seconds Andreas Leitgeb <avl@logic.at> - 2019-07-29 08:01 +0000
        Re: Starting jshell takes about 15 seconds Cecil Westerhof <Cecil@decebal.nl> - 2019-07-29 20:45 +0200
          Re: Starting jshell takes about 15 seconds Cecil Westerhof <Cecil@decebal.nl> - 2019-07-29 21:10 +0200
          Re: Starting jshell takes about 15 seconds Arne Vajhøj <arne@vajhoej.dk> - 2019-08-01 21:05 -0400
        Re: Starting jshell takes about 15 seconds Arne Vajhøj <arne@vajhoej.dk> - 2019-08-01 21:03 -0400

#39016 — Starting jshell takes about 15 seconds

FromCecil Westerhof <Cecil@decebal.nl>
Date2019-07-28 18:04 +0200
SubjectStarting jshell takes about 15 seconds
Message-ID<87tvb6no0u.fsf@munus.decebal.nl>
I have played with jshell before, but at the moment I am a bit more
serious with it. Starting jshell between 15 and 20 seconds. Executing
/reset takes 7 to 10 seconds.
This seems a bit long to me. For example starting ipython3 takes less
as two seconds. Is this normal, or is there a problem with my system?

I am working with Debian 9.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

[toc] | [next] | [standalone]


#39017

FromArne Vajhøj <arne@vajhoej.dk>
Date2019-07-28 19:56 -0400
Message-ID<qhlcna$91c$1@gioia.aioe.org>
In reply to#39016
On 7/28/2019 12:04 PM, Cecil Westerhof wrote:
> I have played with jshell before, but at the moment I am a bit more
> serious with it. Starting jshell between 15 and 20 seconds. Executing
> /reset takes 7 to 10 seconds.
> This seems a bit long to me. For example starting ipython3 takes less
> as two seconds. Is this normal, or is there a problem with my system?
> 
> I am working with Debian 9.

Here starting jshell takes 1-3 seconds depending on the
system. Windows 7 and Ubuntu 18.04 both with Java 11.

Arne

[toc] | [prev] | [next] | [standalone]


#39018

FromAndreas Leitgeb <avl@logic.at>
Date2019-07-29 08:01 +0000
Message-ID<slrnqjt9uk.36g.avl@logic.at>
In reply to#39017
Arne Vajhøj <arne@vajhoej.dk> wrote:
> On 7/28/2019 12:04 PM, Cecil Westerhof wrote:
>> I have played with jshell before, but at the moment I am a bit more
>> serious with it. Starting jshell between 15 and 20 seconds. Executing
>> /reset takes 7 to 10 seconds.
>> This seems a bit long to me. For example starting ipython3 takes less
>> as two seconds. Is this normal, or is there a problem with my system?
>> I am working with Debian 9.
> Here starting jshell takes 1-3 seconds depending on the
> system. Windows 7 and Ubuntu 18.04 both with Java 11.

The machine's RAM and # of cores may be more significant here
than the OS or even the CPU or bogomips.

(And in case of enough RAM, then also whether jshell is already
in the cache versus first-start.)

PS: Ubuntu here with 8GB on core i7 2.80GHz (HW about 10 years old):
  first jshell start: roughly 6 secs, second one roughly 2 secs

$ time $JAVA12_HOME/bin/jshell <<< "/exit"
|  Welcome to JShell -- Version 12.0.2
|  For an introduction type: /help intro

jshell> |  Goodbye

real    0m1.708s      <--
user    0m4.728s      <-- that's where # of cores comes in.
sys     0m0.264s

[toc] | [prev] | [next] | [standalone]


#39019

FromCecil Westerhof <Cecil@decebal.nl>
Date2019-07-29 20:45 +0200
Message-ID<87pnlsof1z.fsf@munus.decebal.nl>
In reply to#39018
Andreas Leitgeb <avl@logic.at> writes:

> Arne Vajhøj <arne@vajhoej.dk> wrote:
>> On 7/28/2019 12:04 PM, Cecil Westerhof wrote:
>>> I have played with jshell before, but at the moment I am a bit more
>>> serious with it. Starting jshell between 15 and 20 seconds. Executing
>>> /reset takes 7 to 10 seconds.
>>> This seems a bit long to me. For example starting ipython3 takes less
>>> as two seconds. Is this normal, or is there a problem with my system?
>>> I am working with Debian 9.
>> Here starting jshell takes 1-3 seconds depending on the
>> system. Windows 7 and Ubuntu 18.04 both with Java 11.
>
> The machine's RAM and # of cores may be more significant here
> than the OS or even the CPU or bogomips.
>
> (And in case of enough RAM, then also whether jshell is already
> in the cache versus first-start.)
>
> PS: Ubuntu here with 8GB on core i7 2.80GHz (HW about 10 years old):
>   first jshell start: roughly 6 secs, second one roughly 2 secs
>
> $ time $JAVA12_HOME/bin/jshell <<< "/exit"

My startup is expensive. When doing it like that I get a real around 9
seconds, but when I use:
    time jshell --no-startup <<< /exit

real is between 1.5 and 2 seconds.

I only do:
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;


    DateFormat dateTimeFormat = new SimpleDateFormat("yyyy-mm-dd HH:mm:ss");


    String currentDateTime() {
        return dateTimeFormat.format(new Date());
    }


    println(currentDateTime());

But it seems it is quit expensive. :'-(

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

[toc] | [prev] | [next] | [standalone]


#39021

FromCecil Westerhof <Cecil@decebal.nl>
Date2019-07-29 21:10 +0200
Message-ID<87h874odw3.fsf@munus.decebal.nl>
In reply to#39019
Cecil Westerhof <Cecil@decebal.nl> writes:

> Andreas Leitgeb <avl@logic.at> writes:
>
>> Arne Vajhøj <arne@vajhoej.dk> wrote:
>>> On 7/28/2019 12:04 PM, Cecil Westerhof wrote:
>>>> I have played with jshell before, but at the moment I am a bit more
>>>> serious with it. Starting jshell between 15 and 20 seconds. Executing
>>>> /reset takes 7 to 10 seconds.
>>>> This seems a bit long to me. For example starting ipython3 takes less
>>>> as two seconds. Is this normal, or is there a problem with my system?
>>>> I am working with Debian 9.
>>> Here starting jshell takes 1-3 seconds depending on the
>>> system. Windows 7 and Ubuntu 18.04 both with Java 11.
>>
>> The machine's RAM and # of cores may be more significant here
>> than the OS or even the CPU or bogomips.
>>
>> (And in case of enough RAM, then also whether jshell is already
>> in the cache versus first-start.)
>>
>> PS: Ubuntu here with 8GB on core i7 2.80GHz (HW about 10 years old):
>>   first jshell start: roughly 6 secs, second one roughly 2 secs
>>
>> $ time $JAVA12_HOME/bin/jshell <<< "/exit"
>
> My startup is expensive. When doing it like that I get a real around 9
> seconds, but when I use:
>     time jshell --no-startup <<< /exit
>
> real is between 1.5 and 2 seconds.
>
> I only do:
>     import java.text.DateFormat;
>     import java.text.SimpleDateFormat;
>
>
>     DateFormat dateTimeFormat = new SimpleDateFormat("yyyy-mm-dd HH:mm:ss");
>
>
>     String currentDateTime() {
>         return dateTimeFormat.format(new Date());
>     }
>
>
>     println(currentDateTime());
>
> But it seems it is quit expensive. :'-(

It is not my startup.jsh, but PRINTING.


time jshell --no-startup <<< /exit
|  Welcome to JShell -- Version 9-Debian
|  For an introduction type: /help intro

jshell> /exit
|  Goodbye

real    0m1.70s
user    0m4.43s
sys     0m0.24s
perc    275.49


time jshell --startup DEFAULT <<< /exit
|  Welcome to JShell -- Version 9-Debian
|  For an introduction type: /help intro

jshell> /exit
|  Goodbye

real    0m3.18s
user    0m8.75s
sys     0m0.38s
perc    286.75


time jshell --startup DEFAULT PRINTING <<< /exit
|  Welcome to JShell -- Version 9-Debian
|  For an introduction type: /help intro

jshell> /exit
|  Goodbye

real    0m8.51s
user    0m22.21s
sys     0m0.71s
perc    269.28


time jshell --startup DEFAULT PRINTING ~/Java/Jshell/startup.jsh <<< /exit
2019-08-29 21:08:50
|  Welcome to JShell -- Version 9-Debian
|  For an introduction type: /help intro

jshell> /exit
|  Goodbye

real    0m9.10s
user    0m22.30s
sys     0m0.63s
perc    251.98


-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

[toc] | [prev] | [next] | [standalone]


#39059

FromArne Vajhøj <arne@vajhoej.dk>
Date2019-08-01 21:05 -0400
Message-ID<qi029j$1v5c$2@gioia.aioe.org>
In reply to#39019
On 7/29/2019 2:45 PM, Cecil Westerhof wrote:
> My startup is expensive. When doing it like that I get a real around 9
> seconds, but when I use:
>      time jshell --no-startup <<< /exit
> 
> real is between 1.5 and 2 seconds.
> 
> I only do:
>      import java.text.DateFormat;
>      import java.text.SimpleDateFormat;
> 
> 
>      DateFormat dateTimeFormat = new SimpleDateFormat("yyyy-mm-dd HH:mm:ss");
> 
> 
>      String currentDateTime() {
>          return dateTimeFormat.format(new Date());
>      }
> 
> 
>      println(currentDateTime());
> 
> But it seems it is quit expensive. :'-(

That code may do more than first meet the eye.

It needs time, timezone, locale etc..

Arne

[toc] | [prev] | [next] | [standalone]


#39058

FromArne Vajhøj <arne@vajhoej.dk>
Date2019-08-01 21:03 -0400
Message-ID<qi025m$1v5c$1@gioia.aioe.org>
In reply to#39018
On 7/29/2019 4:01 AM, Andreas Leitgeb wrote:
> Arne Vajhøj <arne@vajhoej.dk> wrote:
>> On 7/28/2019 12:04 PM, Cecil Westerhof wrote:
>>> I have played with jshell before, but at the moment I am a bit more
>>> serious with it. Starting jshell between 15 and 20 seconds. Executing
>>> /reset takes 7 to 10 seconds.
>>> This seems a bit long to me. For example starting ipython3 takes less
>>> as two seconds. Is this normal, or is there a problem with my system?
>>> I am working with Debian 9.
>> Here starting jshell takes 1-3 seconds depending on the
>> system. Windows 7 and Ubuntu 18.04 both with Java 11.
> 
> The machine's RAM and # of cores may be more significant here
> than the OS or even the CPU or bogomips.
> 
> (And in case of enough RAM, then also whether jshell is already
> in the cache versus first-start.)
> 
> PS: Ubuntu here with 8GB on core i7 2.80GHz (HW about 10 years old):
>    first jshell start: roughly 6 secs, second one roughly 2 secs
> 
> $ time $JAVA12_HOME/bin/jshell <<< "/exit"
> |  Welcome to JShell -- Version 12.0.2
> |  For an introduction type: /help intro
> 
> jshell> |  Goodbye
> 
> real    0m1.708s      <--
> user    0m4.728s      <-- that's where # of cores comes in.
> sys     0m0.264s

Ah - it is multi-threaded.

My fast numbers were on 4c 12GB - the slow were on 1c 4GB.
Not first start.

Arne

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web