libgcj/9392: Creating GregorianCalendar is too slow

tonioc@exeo.com.ar tonioc@exeo.com.ar
Tue Jan 21 19:26:00 GMT 2003


>Number:         9392
>Category:       libgcj
>Synopsis:       Creating GregorianCalendar is too slow
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Jan 21 19:26:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     tonioc@exeo.com.ar
>Release:        3.1
>Organization:
>Environment:
Linux RedHat 7.3, gcc 3.1 (redhat distribution)
>Description:
Calling new GregorianCalendar takes too long.

Creating 30 Gregorian Calendar:
   with sun jdk 1.4 :  ~ 40 milliseconds
   compiled gcj:       ~ 2800 milliseconds
>How-To-Repeat:
Simply execute my Attachment
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="TestDate.java"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="TestDate.java"

CmltcG9ydCBqYXZhLnV0aWwuKjsKCnB1YmxpYyBjbGFzcyBUZXN0RGF0ZQp7CgogICAgcHVibGlj
IFRlc3REYXRlKCkKICAgIHsgIH0KCiAgICBmaW5hbCBpbnQgTUFYPTMwOwoKICAgIHB1YmxpYyB2
b2lkIHdvcmsoKQogICAgewogICAgCVRpbWVyIHRtPW5ldyBUaW1lcigpOwoJR3JlZ29yaWFuQ2Fs
ZW5kYXJbXSBjPW5ldyBHcmVnb3JpYW5DYWxlbmRhcltNQVhdOwoJRGF0ZVtdIGQ9bmV3IERhdGVb
TUFYXTsKCglmb3IgKCBpbnQgaT0wOyBpPE1BWDsgaSsrICkKCSAgICBjW2ldPW5ldyBHcmVnb3Jp
YW5DYWxlbmRhcigpOwoKCXRtLnRvcCgiQ2FsZW5kYXJzIik7CgoJdG0uZWxsYXBzZWQoIlRvdGFs
Iik7CiAgICB9CgoKICAgIHB1YmxpYyBzdGF0aWMgdm9pZAogICAgbWFpbih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