question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Long time to build from a ics file

See original GitHub issue

Describe the bug I try to read a quite large ics file (1.4Mb, 2400 events) and it takes nearly one minute

To Reproduce Steps to reproduce the behavior: I use the java library, version 3.0.6, with this code :

    URL icsUrl = new URL(url);
    HttpURLConnection connexion = (HttpURLConnection)icsUrl.openConnection();

    try (InputStream flux = connexion.getInputStream())
    {  
        CalendarBuilder builder = new CalendarBuilder();
        Calendar calendar = builder.build(flux);
    }

The builder.build(flux) takes nearly 1 minute (I tried to download directly the ics file and it takes less than 1sec)

Is there any way to read it faster ?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
alfonsobonsocommented, Sep 9, 2019

Trying to get closer to this, I am testing with a ics file from my local file system - ~800k, 2500 events with a similar vanilla config as above. It seems the changes in 3.0.5 have severely impacted performance. Average times (ms) to run the builder.build(inputStream):

version time 3.0.9 86477 3.0.6 89591 3.0.5 90608 3.0.4 501 3.0.1 484

It spends a lot of time in:

at java.util.Collections$SynchronizedMap.get(Collections.java:2584) - waiting to lock <0x000000008b642ba8> (a java.util.Collections$SynchronizedMap) at net.fortuna.ical4j.model.DateTime$DateFormatCache.get(DateTime.java:544)

and much time in the construction of java.util.(GregorianCalendar), but I haven’t been able to get closer comparing the 3.0.4 and 3.0.5 release code changes

0reactions
vonox7commented, Mar 26, 2020

Thanks @benfortuna! 3.0.18 fixes now this issue, both CPU and GC levels are back to the state as it was with version 3.0.4! Thank you for the fast fix!

Read more comments on GitHub >

github_iconTop Results From Across the Web

create ics file for calendar-keep getting wrong date/times
Solved: Hello - I am building a flow which creates an ics file that is attached to an email so the end user...
Read more >
How to get ics file to adjust to local time instead of changed time
ics newbie and came across post which cautions against using UTC (stackoverflow.com/a/27674474). Can anyone answer: 1) Is second approach more ...
Read more >
Create a Calendar File Building App - Circuit Cellar
This forms a wrapper for the iCalendar's components. Each calendar component—event, to-do, journal, free/busy, time zone and alarm—is wrapped in ...
Read more >
RFC 5545: Internet Calendaring and Scheduling Core Object ...
RFC 5545 iCalendar September 2009 3.3.12. Time . ... iCalendar object consists of a sequence of calendar properties and one or more calendar...
Read more >
iCal Event Maker - generate ics file (iCalendar) to share your ...
Single or Multiple events. Repeating / Recurring events. with 300 time zones support. add Reminder. Load your existing .ics file to edit the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found