f2e-spec icon indicating copy to clipboard operation
f2e-spec copied to clipboard

Some fixes and refactors for the cache

Open Lord-Kamina opened this issue 2 years ago • 6 comments

What does this PR do?

Closes Issue(s)

Motivation

More

  • [ ] Added/updated documentation

Additional Notes

Lord-Kamina avatar Apr 15 '22 15:04 Lord-Kamina

I don't see why all of these is required:

  • Json should be a header only library, why do we need to add the include of the libraries in CMake
  • There is a lot of indent change that are not related to this PR
  • I am not a bug fan of pulluting the fs library with json related code (I was already reluctant to have it in a core structure such as Songs) (it also complexify the CMake file),
  • please don't use contains instead of count since it was carefully chosen in order to lower the dependency version,
  • also this patch since to activate the cache reading in all Performous versions whereas it was only activated when compiling using webserver feature (this was carefully chosen because it seemed that the cache loading still had problems).

yoda-jm avatar Apr 17 '22 21:04 yoda-jm

I don't see why all of these is required:

  • Json should be a header only library, why do we need to add the include of the libraries in CMake

That's a fair point, and it might be unnecessary.

  • There is a lot of indent change that are not related to this PR

Yes. It just seemed awkward to make a PR to correct the indent of code that hasn't been touched in ages, when I'm changing something literally next to it.

  • I am not a bug fan of pulluting the fs library with json related code (I was already reluctant to have it in a core structure such as Songs) (it also complexify the CMake file),

The reason I'm doing this is because my reworked webserver uses json elsewhere and thus we'd have to begin duplicating code.

I put it in fs because it seemed the most fitting.

Where else would you put it? Its own file?

  • please don't use contains instead of count since it was carefully chosen in order to lower the dependency version,

And I tried at first, but truly what's the point? What system/configuration are you trying to support out of the box here? Ubuntu 18.04? That has nlohmann 2, the last version of which was released five years ago. Nlohmann 3 is faster, more robust and supports exceptions properly. If you can show me a single relevant case where using 3.6.0 instead of an earlier 3.x version will make it easier for anyone, I'll change it back to count.

  • also this patch since to activate the cache reading in all Performous versions whereas it was only activated when compiling using webserver feature (this was carefully chosen because it seemed that the cache loading still had problems).

Does it? @Baklap4 correct me if I'm wrong but I think the only actual reason the cache depended on webserver is because they were both supplied by CppRest (which came with several other dependencies as well)

Lord-Kamina avatar Apr 17 '22 21:04 Lord-Kamina

Does it? @Baklap4 correct me if I'm wrong but I think the only actual reason the cache depended on webserver is because they were both supplied by CppRest (which came with several other dependencies as well)

@Lord-Kamina They were both supplied by CppRest so that's why webserver support 'depended' on json. Now with nlohmann-json it can be added as an option or become part of the core system. If it becomes part of the core system the lib should be required, else can be optional.

Baklap4 avatar Apr 23 '22 13:04 Baklap4

I removed the change to reload_internal entirely. I still left three commits, with the removal of the #IFDEF WEBSERVER bit on its own commit.

Lord-Kamina avatar Apr 26 '22 19:04 Lord-Kamina

Played a few songs with vocals + guitar using the AppImage and packages on Ubuntu 18.04 & 20.04. Didn't notice any effects on gameplay, which is to be expected I believe. If anything, the cached songs are loaded faster, and load in a few seconds rather than the 30 seconds + that it used to take.

ooshlablu avatar May 22 '22 16:05 ooshlablu