-
Notifications
You must be signed in to change notification settings - Fork 764
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PolymorphicVirtualCaster StaticObject instantiation takes a very long time at app startup #354
Comments
cereal has always made these Is the behavior reproducible with a simple test case to isolate cereal as the cause of the problem? |
Hmm Interesting....I'm using Xcode, so when I pause the application on startup to see what's taking so long, it's always busy initializing global variables - These StaticObjects. I was using this version here: https://www.dropbox.com/sh/zutlvwslrqvfdwy/AACoCxAiiZYnB9rSBLTt_Usna?dl=0 I did some slight modifications to it in order to compile for the Android NDK (replace std::to_string) |
I'm not exactly sure which version that is since we don't include the version number in the source, but the biggest difference I can see is that the old version you were using was prior to us properly a detail related to dynamic casting between polymorphic types. This fix involved the creation of a new StaticObject, so potentially your issue is related to this, but I would need more information to either reproduce or know exactly which parts seem to be slowing you down. Do you have a complicated class hierarchy at work, or a lot of polymorphic registrations? I can't think of anything we do that would cause such a dramatic increase in your runtime, unless there is some obscure edge case you are hitting. |
Haha, yeah that's why I couldn't tell you the version. Well, yes. I'm working on a strategy video game and implemented a custom Entity Component System. I'm registering every single entity and component class at the end of the header file. It's probably around 100 headers plus registering some multiple times (different template instantiations). In total it might be 200-300 registrations. In the previous version, all is fine and I was super happy that cereal did such a great job (especially serializing between iOS and Android, which would have been very painful). But the new version is just unusable unfortunately. I can't send you my huge project obviously....I could offer a skype call and show you how long it takes / let you step through my debugger if that helps. |
Can you do me a favor and try the current development version of cereal? You'll have to clone it from github. If we are lucky it may already solve the problem, but I don't think that will be the case. I think I can guess what is causing your problem, but I'll have to make a huge test case to see if I can reproduce it. If you can profile, I'm guessing the time is spent in We fixed a bug related to polymorphism that required us to implement a way for cereal to know how to dynamic cast either direction in any polymorphic hierarchy. We get these relations automatically whenever you use something like One thing we try to do at initialization is to find all shortest paths of casting between polymorphic types. For example, you might have a hierarchy A->B->C, and let's say each one of those classes serializes its base, so we explicitly know the paths A<->B, and B<->C. We then try to see if we can do any of these transitions shorter, and discover that A->B->C can be reduced to A<->C. Since you have so many registrations, I'm guessing that cereal spends a large amount of time trying to optimize these paths. The current algorithm is probably very inefficient, glancing at it it looks to be something like O(n^2) in the number of registrations. Another workaround you can try, is in the newer version of cereal you already downloaded, comment out everything in
by using |
@AzothAmmo It's interesting that you say that....I was facing many issues with Polymorphism recently...very often when I was trying to serialize a Anyway....that's another issue. I might also open another ticket once this one here is sorted - just wanted to tell you that I've faced some of those. Here's a Screenshot from the Xcode Time Profiler, profiling on an iPad Pro (hence the fastest device I currently target). Since the Profiler performed a release build, the time it took went down drastically to around 2 seconds, instead of 30-60. But even with this, I would still opt for the old cereal version, since it will take 10 seconds at least on older Android devices. These Removing the piece of code that you suggested lead to exactly the expected results: Super fast startup times, but |
I've already planned out an efficient algorithm to replace what we are currently using, and hopefully this will resolve the issue. |
-This version has all of the debug messages left in, next commit will remove them -Algorithm description provided in comments -relates #354
-Also forgot to mention that I think there was a bug with upcasting before where the casting was incorrectly done in the reverse order. -relates #354
Try out the latest develop commit and see if this works for you, I haven't been able to test this on a large test case yet. |
With this Version my App takes 38 seconds to start up on an iPad Pro. I'm sorry to tell that it didn't help much. |
Ok, I'll have to make a test case with a large number of classes to try and narrow this down. Right now we try to update the relations on every registration (since there is no way of knowing when registrations are done), but perhaps this could be deferred to either be manually done (e.g., in main), or the first time a serialization is done. Maybe this will be a compile time flag to control when this is done, I'm not sure yet. |
Ah, so you mean that it is slow because it's trying to update the relations every single time for all registrations? Doing it one time in main might be super fast then? |
Yes, every time cereal gets a registration it tries to update all paths related to the registration. It basically traverses a tree (not technically a tree because of diamond inheritance) for the current class hierarchy being registered and updates all parent nodes with the shortest path to children. So it's not wasting a lot of time on unrelated registrations, but the deeper a class hierarchy is the more work must be done. |
Okay, I see. So it shouldn't take too much time actually. It'll be interesting if not doing it for every registration would bring the time back down to 3 seconds instead of 30 or if it would be still like 5+ seconds. If none of the improvements are of any help, I'd have to manually mark the parent / child relations right? I'm definitely curious to see where this is going / what the solution might be, thanks again. |
I'm trying to build a test for this - can you give me an idea of how many classes are in your hierarchies? How wide/deep are they, how many, etc. Approximates are fine, I just need to create a test case to hone in on this. |
Sure: I'm registering around 200 classes and the typical depth is 5. Of course some go deeper to 7-9 and some others only 2-3, but 5 is definitely the average.
|
Hey, I just wanted to check back and ask if you've been able to get some kind of progress / improvement working yet. We're still using a very old version of cereal since we can't update due to the incredibly long startup time. |
@AzothAmmo We recently pulled in cereal's master branch and are experiencing similar issues as @ForestRingGames around startup, but with much beefier computers. I might be able to offer additional assistance tracking down the source of the slowdown. We've got around 200 message classes as well (183-ish to be precise), almost all of which have only 1 or 2 parents. I've got some perf-based profiling working as well, and through that, on master, I can see an inordinately large amount of time being spent creating, erasing, and copying the red-black tree nodes underlying the polymorphic relation map https://github.com/USCiLab/cereal/blob/master/include/cereal/details/polymorphic_impl.hpp#L116 I'm not familiar with the evolution of the polymorphism feature, and it seems likely that that knowledge will lead to a better understanding of what changed, but one thing that strikes me is that an unordered_map might be more appropriate there... But first, I'm going to run a compile and couple of experiments against develop and see if I get similar results. |
and as it turns out, your develop branch makes a big difference on my startup times [factor of 10ish], so it may be the depth or complexity of @ForestRingGames classgraph... |
I can optimize the implementation further when I get around to making a test case. I haven't been working on cereal over the holidays but I'm going to make a push to close some issues and get the next release out soon. |
@AzothAmmo Okay, sounds good! I can still offer you to do a skype session and show you the profiler running on my project to help you figure out what the issue is exactly. If you're up for that just message me via max {at} forestringgames {dot} com |
There may be a solution to that as a result of #388, which I need to test. The downside to this solution is that it will require specificity when registering types, i.e. binding a polymorphic type to a specific type of archive, instead of it applying to any future archive. I'm also curious to test boost under similar circumstances, since our implementation is a modified version of theirs. I'm going to take the optimizations for runtime that are present here and push them to develop soon - there is likely room for future optimization but this is a good starting point for now. |
I'd actually be fine with that. We're only using one type of archive anyway (BinaryPortable to be able to exchange the same data between all kinds of iOS and Android devices). Testing boost would be interesting, before choosing cereal I wanted to try boost but it looked very heavy-weight and heard to get to compile for iOS and Android. I think it was a non-header-only lib of boost. We're looking forward to test any possible improvement. |
I forgot to ask: Do you know of any possible (hack-) fix, how we can avoid the huge memory usage on compiling? We'd just like to get the project to compile, so that we can start working with the windows machine. Is there maybe an old version that didn't have the issue or something similar? |
It shouldn't be a big change, I can likely commit tomorrow. If my hunch is right on what causes the memory use, it will be present in all past versions of cereal (and also in boost).
…-----Original Message-----
From: "ForestRingGames" <notifications@github.com>
Sent: 4/11/2017 4:22 PM
To: "USCiLab/cereal" <cereal@noreply.github.com>
Cc: "Shane Grant" <w.shane.grant@gmail.com>; "State change" <state_change@noreply.github.com>
Subject: Re: [USCiLab/cereal] PolymorphicVirtualCaster StaticObjectinstantiation takes a very long time at app startup (#354)
I forgot to ask: Do you know of any possible (hack-) fix, how we can avoid the huge memory usage on compiling? We'd just like to get the project to compile, so that we can start working with the windows machine. Is there maybe an old version that didn't have the issue or something similar?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.
|
This is going to take a bit more investigation than I thought - I just ran a single test showing 2x the memory use of boost for compilation, so the issue may be more nuanced. |
Okay, thanks for the update. Do you also see crazy memory consumption like 8+ GB for 300+ polymorphic registrations? |
It varies quite a bit depending on which test I run. I have one which does somewhere around 100 registrations against every archive type which uses at least 8GB, but the same registrations done against a single archive type are topping out at 2GB. I've never seen any adverse affect at runtime though (e.g. segfaults), but if you are getting segfaults with your compiler perhaps it is due to memory limitations. |
still needs more work but this is an improvement for now see #354
commit aa891a4 Author: Shane Grant <w.shane.grant@gmail.com> Date: Mon Jun 26 13:42:08 2017 -0700 Resolves USCiLab#414 commit fcef0da Author: Shane Grant <w.shane.grant@gmail.com> Date: Fri May 5 11:37:12 2017 -0700 Fix shadowing issue for USCiLab#401, recent osx compile issue re: USCiLab#354 commit 950aca4 Merge: ad90557 35a36af Author: Shane Grant <w.shane.grant@gmail.com> Date: Fri May 5 11:09:34 2017 -0700 Merge branch 'hoensr-xml-no-size-attributes' into develop commit 35a36af Author: Shane Grant <w.shane.grant@gmail.com> Date: Fri May 5 10:54:25 2017 -0700 Standardize interface for options (xml) see USCiLab#401 commit ad90557 Merge: f031131 2ab15f7 Author: Shane Grant <w.shane.grant@gmail.com> Date: Wed May 3 11:39:02 2017 -0700 Merge branch 'develop' of github.com:USCiLab/cereal into develop commit f031131 Author: Shane Grant <w.shane.grant@gmail.com> Date: Wed May 3 11:38:35 2017 -0700 modifications for g47 and comment out memory intensive testing commit c4dcc8d Merge: 68f56ee 676d329 Author: Shane Grant <w.shane.grant@gmail.com> Date: Wed May 3 11:11:08 2017 -0700 Merge branch 'issue_354' into develop still needs more work but this is an improvement for now see USCiLab#354 commit 52b03d5 Author: Robin Hoens <robin.hoens@qiagen.com> Date: Mon Apr 10 17:13:39 2017 +0200 Add option to turn off the size=dynamic attributes of lists commit 2ab15f7 Merge: 68f56ee 7723503 Author: Shane Grant <w.shane.grant@gmail.com> Date: Tue Apr 11 16:17:51 2017 -0700 Merge pull request USCiLab#397 from albertziegenhagel/issue_396 Add remove_reference to determine whether template argument to BinaryData is const commit 7723503 Author: Albert Ziegenhagel <albert.ziegenhagel@scai.fraunhofer.de> Date: Tue Apr 11 10:32:55 2017 +0200 Add remove_reference to determine whether template argument to BinaryData is const commit 68f56ee Author: Shane Grant <w.shane.grant@gmail.com> Date: Mon Apr 10 11:22:38 2017 -0700 Remove undefined behavior, see USCiLab#390 commit 676d329 Author: Shane Grant <w.shane.grant@gmail.com> Date: Wed Feb 22 14:43:31 2017 -0800 adventures in microoptimization USCiLab#354 commit 546fd9b Author: Shane Grant <w.shane.grant@gmail.com> Date: Sun Feb 19 16:25:32 2017 -0800 tinkering on USCiLab#354 commit 8b8f581 Author: Shane Grant <w.shane.grant@gmail.com> Date: Wed Feb 15 13:39:42 2017 -0800 Fix macro for double comparison in unit test relates USCiLab#338 commit 51cbda5 Merge: 70c4420 e38d6fe Author: Shane Grant <w.shane.grant@gmail.com> Date: Sun Feb 12 14:06:58 2017 -0800 Merge branch 'develop' for release 1.2.2 commit e38d6fe Author: Shane Grant <w.shane.grant@gmail.com> Date: Sun Feb 12 13:46:25 2017 -0800 fix update doc script commit 70c4420 Author: Shane Grant <w.shane.grant@gmail.com> Date: Sun Feb 12 00:25:30 2017 -0800 Update README.md add appveyor badge commit 2590f21 Author: Shane Grant <w.shane.grant@gmail.com> Date: Sat Feb 11 23:47:00 2017 -0800 Properly use multimap for lookup in poly casting relates USCiLab#356, still need final testing on MSVC commit a917374 Author: Shane Grant <w.shane.grant@gmail.com> Date: Wed Feb 8 10:47:02 2017 -0800 size_type now specified by macro CEREAL_SIZE_TYPE resolves USCiLab#379 commit ee17db5 Merge: b827b95 f577fc4 Author: Shane Grant <w.shane.grant@gmail.com> Date: Mon Feb 6 22:51:29 2017 -0800 Merge branch 'develop' of github.com:USCiLab/cereal into develop commit b827b95 Author: Shane Grant <w.shane.grant@gmail.com> Date: Mon Feb 6 22:50:56 2017 -0800 Fixes need for special MSVC case, see USCiLab#373 commit f577fc4 Author: Shane Grant <w.shane.grant@gmail.com> Date: Sun Feb 5 22:13:08 2017 -0800 Turn on warnings as errors for MSVC, warning level to 3 Can't do level 4 warnings yet - need to make an upstream change to doctest commit fb6606d Author: Shane Grant <w.shane.grant@gmail.com> Date: Sun Feb 5 18:13:37 2017 -0800 Do not build coverage or valgrind for MSVC commit a2d5a15 Merge: 4a92e29 e4d543d Author: Shane Grant <w.shane.grant@gmail.com> Date: Fri Jan 27 10:29:51 2017 -0800 Merge branch 'tusharpm-develop' into develop see USCiLab#373 Still need to address why windows needed a modifcation to polymorphic test to compile commit e4d543d Author: Tushar Maheshwari <tushar27192@gmail.com> Date: Thu Jan 26 16:53:47 2017 +0530 Fix merge issues commit 2261fee Author: Tushar Maheshwari <tushar27192@gmail.com> Date: Sun Dec 18 17:32:04 2016 +0530 Pull requests to not increment build numbers commit 4ff4db8 Author: Tushar Maheshwari <tushar27192@gmail.com> Date: Sun Dec 11 20:03:02 2016 +0530 boost new version commit 655696a Author: Tushar Maheshwari <tushar27192@gmail.com> Date: Sun Dec 11 15:42:00 2016 +0530 AppVeyor integration commit df44243 Author: Tushar Maheshwari <tushar27192@gmail.com> Date: Sun Dec 11 01:01:10 2016 +0530 Enable cross-platform portability test CMake fix 32-bit executable with generator Win64 commit 0a908bc Author: Tushar Maheshwari <tushar27192@gmail.com> Date: Sat Dec 10 17:27:28 2016 +0530 Make tests pass with Windows commit 4a92e29 Author: Shane Grant <w.shane.grant@gmail.com> Date: Wed Jan 25 11:04:24 2017 -0800 no longer need boost test in travis commit a8e9963 Merge: 75e50ee 1d67d44 Author: Shane Grant <w.shane.grant@gmail.com> Date: Wed Jan 25 10:56:38 2017 -0800 Merge branch 'develop_doctest' into develop see USCiLab#139 commit 75e50ee Author: Shane Grant <w.shane.grant@gmail.com> Date: Mon Nov 28 13:48:46 2016 -0800 remove old code from sandbox relates USCiLab#363 commit 507f97d Author: Shane Grant <w.shane.grant@gmail.com> Date: Mon Nov 28 11:53:56 2016 -0800 add -Wold-style-casts see USCiLab#363 commit f69ad7c Author: Shane Grant <w.shane.grant@gmail.com> Date: Mon Nov 28 11:50:23 2016 -0800 tab to space commit d21b0c0 Merge: 29829c1 e63f08f Author: Shane Grant <w.shane.grant@gmail.com> Date: Mon Nov 28 11:47:53 2016 -0800 Merge branch 'laudrup-master' into develop see USCiLab#363 commit e63f08f Author: Shane Grant <w.shane.grant@gmail.com> Date: Mon Nov 28 11:47:24 2016 -0800 minor adjustments to casts, see comments on USCiLab#363 commit 29829c1 Merge: 9978e0c ad92746 Author: Shane Grant <w.shane.grant@gmail.com> Date: Mon Nov 28 10:41:27 2016 -0800 Merge branch 'FlexCoreLib-doxygen_access_from_extern' into develop see USCiLab#365 commit ad92746 Author: Shane Grant <w.shane.grant@gmail.com> Date: Mon Nov 28 10:41:02 2016 -0800 comment out obsolete doxygen commit 9978e0c Merge: 1edc5c6 6e71766 Author: Shane Grant <w.shane.grant@gmail.com> Date: Mon Nov 28 10:37:17 2016 -0800 Merge pull request USCiLab#366 from headupinclouds/pr.is_loading.is_saving Add is_loading and is_saving values to cereal::{Input,Output}Archive commit 1edc5c6 Merge: 72d7936 6086234 Author: Shane Grant <w.shane.grant@gmail.com> Date: Mon Nov 28 10:35:24 2016 -0800 Merge pull request USCiLab#367 from tusharpm/develop Travis configuration updates commit 6086234 Author: Tushar Maheshwari <tushar27192@gmail.com> Date: Sun Nov 27 13:57:26 2016 +0530 Travis configuration updates - Switch to trusty container-based infrastructure for linux systems - Add a job to test with clang compiler (skips portability test) - Add a job to test on macOS with Xcode8 commit 6e71766 Author: David Hirvonen <dhirvonen@elucideye.com> Date: Sat Nov 26 12:31:56 2016 -0500 Remove spurious character commit 9376ca6 Author: Kasper Laudrup <laudrup@stacktrace.dk> Date: Wed Nov 23 01:34:53 2016 +0100 Don't use C style casts Change C style casts to C++ static casts. This makes the code compile with the -Wold-style-cast warning enabled commit 1d67d44 Author: Shane Grant <w.shane.grant@gmail.com> Date: Fri Nov 4 16:07:00 2016 -0700 Removed boost_test as a requirement -Now build 32 bit unit tests if portability testing is enabled -No more boost+clang issues over std::string abi see USCiLab#139, USCiLab#123 commit 66528b6 Author: Shane Grant <w.shane.grant@gmail.com> Date: Fri Nov 4 15:51:57 2016 -0700 last? conversions for USCiLab#139 commit 978b3b5 Author: Shane Grant <w.shane.grant@gmail.com> Date: Fri Nov 4 12:11:51 2016 -0700 typo fix in comment USCiLab#139 commit 13ae560 Author: Shane Grant <w.shane.grant@gmail.com> Date: Fri Nov 4 12:10:24 2016 -0700 more USCiLab#139 commit 07818f4 Author: Shane Grant <w.shane.grant@gmail.com> Date: Fri Nov 4 12:00:16 2016 -0700 more USCiLab#139 commit b5e500d Author: Shane Grant <w.shane.grant@gmail.com> Date: Wed Nov 2 16:32:35 2016 -0700 more USCiLab#139 commit a6e59d7 Author: Shane Grant <w.shane.grant@gmail.com> Date: Wed Nov 2 13:38:33 2016 -0700 more for USCiLab#139 commit cd46374 Author: Shane Grant <w.shane.grant@gmail.com> Date: Wed Nov 2 12:20:22 2016 -0700 more converted for USCiLab#139 commit 38e1548 Author: Shane Grant <w.shane.grant@gmail.com> Date: Tue Nov 1 11:59:40 2016 -0700 headers USCiLab#139 commit 15c7339 Author: Shane Grant <w.shane.grant@gmail.com> Date: Tue Nov 1 11:59:02 2016 -0700 more conversions USCiLab#139 commit 928cd36 Author: Shane Grant <w.shane.grant@gmail.com> Date: Tue Nov 1 11:41:28 2016 -0700 more conversions to CHECK_EQ see USCiLab#139 commit 0a262ec Author: Shane Grant <w.shane.grant@gmail.com> Date: Tue Nov 1 11:36:22 2016 -0700 More tests split, switch to CHECk_EQ over CHECK see USCiLab#139 commit 671999e Author: Shane Grant <w.shane.grant@gmail.com> Date: Fri Oct 28 14:28:37 2016 -0700 Initial progress on removing boost test and moving to doctest to better support modules relates USCiLab#123 commit a066808 Author: Caspar Kielwein <Caspar@Kielwein.de> Date: Sun Oct 2 16:09:04 2016 +0200 Add cereal.doxytags as tagfile to allow external projects to link to cereal documentation. commit 3fb59db Author: Caspar Kielwein <Caspar@Kielwein.de> Date: Sun Oct 2 15:53:28 2016 +0200 Build doxygen documentation with separate CMakeLists. Extracted CMakelists.txt to doc subdirectory. Changed paths in doxyfile.in and CMakeLists accordingly. added doc as subdirectory in main CMakeLists.txt.
I'm revisiting issues I had previously worked on and see that there were a few commits to develop based on the work here, but it's a bit unclear what the remaining issues are. Perhaps it would be best to open new tickets, link to this one, and close the discussion here. |
Cereal updated for work being done in another branch. This bump fixes some issues with the library. Tested v1.3.1 Bug fixes and minor enhancements: Fix typo in docs by @tankorsmash in Fix typo in docs USCiLab/cereal#597 Add MSVC 2019 to build, default ctor for static object by @AzothAmmo in Add MSVC 2019 to build, default ctor for static object USCiLab/cereal#593 Fix json.hpp compilation issue when int32_t is a long by @bblackham in Fix json.hpp compilation issue when int32_t is a long USCiLab/cereal#621 [cpp20] explicitly capture 'this' as copy by @lukaszgemborowski in [cpp20] explicitly capture 'this' as copy USCiLab/cereal#640 Fix rapidjson for Clang 10 by @groscoe2 in Fix rapidjson for Clang 10 USCiLab/cereal#645 Fixes to prevent clang-diagnostic errors by @johngladp in Fixes to prevent clang-diagnostic errors USCiLab/cereal#643 cleanup cmake files to be a little more moderen by @ClausKlein in cleanup cmake files to be a little more moderen USCiLab/cereal#659 GHSA-wgww-fh2f-c855: Store a copy of each serialized shared_ptr within the archive to prevent the shared_ptr to be freed to early. by @serpedon in CVE-2020-11105: Store a copy of each serialized shared_ptr within the archive to prevent the shared_ptr to be freed to early. USCiLab/cereal#667 add license files for components of cereal by @miartad in add license files for components of cereal USCiLab/cereal#676 Catch short documents in JSON input by @johnkeeping in Catch short documents in JSON input USCiLab/cereal#677 C++17: use inline globals for StaticObjects by @InBetweenNames in C++17: use inline globals for StaticObjects USCiLab/cereal#657 Use std::variant::emplace when loading by @kepler-5 in Use std::variant::emplace when loading USCiLab/cereal#699 Use std::optional::emplace() when loading non-empty optional by @kepler-5 in Use std::optional::emplace() when loading non-empty optional USCiLab/cereal#698 Fix itsNextName not clearing when not found + style change by @AzothAmmo in Fix itsNextName not clearing when not found + style change USCiLab/cereal#715 Update doctest to 2.4.6 + local fixes slated for upstream by @AzothAmmo in Update doctest to 2.4.6 + local fixes slated for upstream USCiLab/cereal#716 Fixed loading of std::vector by @Darred in Fixed loading of std::vector<bool> USCiLab/cereal#732 Update license to match BSD template by @AzothAmmo in Update license to match BSD template USCiLab/cereal#735 Update doctest to 2.4.7 by @AzothAmmo in Update doctest to 2.4.7 USCiLab/cereal#736 Use GNUInstallDirs instead of hard wiring install directories by @antonblanchard in Use GNUInstallDirs instead of hard wiring install directories USCiLab/cereal#710 This is not an exhaustive list of changes or individual contributions. See the closed issues or complete changelog for more information. v1.3.0 New features include: Deferred serialization for smart pointers (Stack overflow for large chains of shared_ptr (or smart pointers in general) USCiLab/cereal#185) Initial support for C++17 standard library variant and optional (thanks to @arximboldi, Add serialization support for C++17 std::optional and std::variant USCiLab/cereal#448) Support for std::atomic (thanks to @bluescarni, Implementation and testing of std::atomic serialization. USCiLab/cereal#277) Fixes and enhancements include: Vastly improved continuous integration testing (Appveyor updates + boost testing fixes USCiLab/cereal#568, Update Travis CI USCiLab/cereal#569) Fixed several issues related to compilation on newer compilers (Fixing various compilation warnings USCiLab/cereal#579, Add fall through comments to json.hpp USCiLab/cereal#587, Fix warning unused private member itsValueItEnd USCiLab/cereal#515) Fixed warnings with -Wconversion and -Wdocumentation (thanks to @WSoptics, Develop USCiLab/cereal#423) Performance improvements for polymorphic serialization (PolymorphicVirtualCaster StaticObject instantiation takes a very long time at app startup USCiLab/cereal#354) Minor fixes and enhancements include: Fixed a bug related to CEREAL_REGISTER_DYNAMIC_INIT with shared libraries (thanks to @m2tm, Issue correctly using CEREAL_REGISTER_DYNAMIC_INIT USCiLab/cereal#523) Avoid unnecessary undefined behavior with StaticObject (thanks to @erichkeane, Change StaticObject instance management to hopefully avoid UBSAN USCiLab/cereal#470) New version.hpp file describes cereal version (detect cereal version at compile time / version.hpp USCiLab/cereal#444) Ability to disable size=dynamic attribute in the XML archive (thanks to @hoensr, Add option to turn off the size=dynamic attributes of lists USCiLab/cereal#401) Other Notes The static checking for minimal serialization has been relaxed as there were many legitimate cases it was interfering with (thanks to @h-2, remove const check from load_minimal USCiLab/cereal#565) The vs2013 directory has been removed in favor of generating solutions with CMake (Remove vs2013 directory USCiLab/cereal#574)
I recently updated to a newer version of cereal and it seems like some things have changed.
On startup Cereal creates these "StaticObject" instances now for every polymorphic registration.
My app now takes around 60 seconds to startup, compared to 1 second previously. I'm on iOS with an iPad Pro.
Why does this happen now?
What's the benefit of these StaticObjects?
Can I turn this off somehow?
The text was updated successfully, but these errors were encountered: