Subject Re: [Firebird-Java] Jaybird 3 and Excelsior Jet
Author Mark Rotteveel
On 13-5-2017 11:09, hugo.larson@... [Firebird-Java] wrote:
>
>
> Hello,
>
> We compile our software with Excelsior Jet (java 1.7.0_55) for many
> years with Jaybird 2.2.12.
>
> I tried with Jaybird 3 and the this is a part of messages printed on the
> console. There is a notable delay every time the message is printed.

By the looks of it, I'd say that Excelsior Jet is very slow if it can't
find a character set loaded by Charset.forName.

I could potentially make the character set loading lazy (so only if it
is really needed), but I'd need to check if that doesn't break
assumptions elsewhere.

Could you give me the results of running the following as an Excelsior
Jet program:

====
import java.nio.charset.Charset;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;

public class CharsetLoading {

private static final Logger LOG =
Logger.getLogger(CharsetLoading.class.getName());

public static void main(String[] args) {
long start = System.nanoTime();
LOG.info("Starting");
Map<String, Charset> charsetMap = new HashMap<>();
for (String charsetName : new String[]{"US-ASCII", "UTF-8",
"MS932", "EUC_JP", "Cp737", "Cp437", "Cp850", "Cp865",
"Cp860", "Cp863", "Cp775", "Cp858", "Cp862", "Cp864",
"ISO-8859-1", "ISO-8859-2", "ISO-8859-3", "ISO-8859-4",
"ISO-8859-5", "ISO-8859-6", "ISO-8859-7", "ISO-8859-8",
"ISO-8859-9", "ISO-8859-13", "MS949", "Cp852", "Cp857",
"Cp861", "Cp866", "Cp869", "Cp1250", "Cp1251", "Cp1252",
"Cp1253", "Cp1254", "Big5", "EUC_CN", "Cp1255", "Cp1256",
"Cp1257", "KOI8_R", "KOI8_U", "Cp1258", "TIS620", "GBK",
"Cp943C", "GB18030" }) {
try {
Charset charset = Charset.forName(charsetName);
LOG.info("Loaded charset " + charsetName);
charsetMap.put(charsetName, charset);
} catch (Exception e) {
LOG.severe("Can't load " + charsetName);
}
}
LOG.info(charsetMap.toString());
long end = System.nanoTime();

long duration = end - start;
LOG.info("Took " + duration + " ns (" +
TimeUnit.NANOSECONDS.toMillis(duration) + " ms)");
}
}
====

For reference, the output when I run this is on Java 8 update 131 is:

mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Starting
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset US-ASCII
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset UTF-8
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset MS932
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset EUC_JP
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp737
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp437
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp850
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp865
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp860
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp863
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp775
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp858
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp862
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp864
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset ISO-8859-1
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset ISO-8859-2
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset ISO-8859-3
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset ISO-8859-4
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset ISO-8859-5
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset ISO-8859-6
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset ISO-8859-7
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset ISO-8859-8
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset ISO-8859-9
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset ISO-8859-13
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset MS949
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp852
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp857
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp861
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp866
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp869
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp1250
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp1251
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp1252
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp1253
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp1254
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Big5
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset EUC_CN
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp1255
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp1256
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp1257
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset KOI8_R
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset KOI8_U
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp1258
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset TIS620
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset GBK
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset Cp943C
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Loaded charset GB18030
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: {Cp943C=x-IBM943C, Cp850=IBM850, Cp1257=windows-1257,
Cp1258=windows-1258, Cp437=IBM437, Big5=Big5, Cp775=IBM775,
Cp852=IBM852, Cp737=x-IBM737, Cp858=IBM00858, GB18030=GB18030,
Cp857=IBM857, MS932=windows-31j, GBK=GBK, Cp1255=windows-1255,
Cp1256=windows-1256, Cp1253=windows-1253, Cp1254=windows-1254,
EUC_CN=GB2312, Cp1251=windows-1251, Cp1252=windows-1252,
Cp1250=windows-1250, ISO-8859-4=ISO-8859-4, ISO-8859-3=ISO-8859-3,
ISO-8859-2=ISO-8859-2, ISO-8859-1=ISO-8859-1, Cp862=IBM862,
ISO-8859-8=ISO-8859-8, ISO-8859-7=ISO-8859-7, Cp861=IBM861,
Cp860=IBM860, ISO-8859-6=ISO-8859-6, UTF-8=UTF-8, ISO-8859-5=ISO-8859-5,
ISO-8859-13=ISO-8859-13, Cp866=IBM866, Cp865=IBM865, Cp864=IBM864,
Cp863=IBM863, ISO-8859-9=ISO-8859-9, Cp869=IBM869, US-ASCII=US-ASCII,
KOI8_R=KOI8-R, TIS620=TIS-620, MS949=x-windows-949, EUC_JP=EUC-JP,
KOI8_U=KOI8-U}
mei 14, 2017 1:44:00 PM nl.lawinegevaar.CharsetLoading main
INFO: Took 107617388 ns (107 ms)

Mark
--
Mark Rotteveel