Highload-fun / platform

33 stars 0 forks source link

Add some way of including or generating large lookup tables #16

Closed sharpobject closed 2 years ago

sharpobject commented 2 years ago

Hello,

I'd like to use large lookup tables sometimes. I cannot upload them because it seems like the limit for the size of uploads is around 2-4MB. I cannot generate them because the compiler is killed if I try to generate them.

For example, you can try to submit this C++ code:

#include <cstddef>
constexpr size_t help()
{
  for (size_t j=0; j < 0x2000000; j++);
  return 0;
}
static constexpr size_t lol = help();
int main() {
  return 0;
}

and pass these flags to g++: -std=c++17 -march=native -fconstexpr-loop-limit=2000000000 -fconstexpr-ops-limit=2000000000 or pass these flags to clang: -std=c++17 -march=native -fconstexpr-steps=2000000000

then the compiler will be killed, perhaps for running for too long. This program just counts to 33 million at compile time. Actually generating a big lookup table would probably take more steps than that.

sergei-svistunov commented 2 years ago

Hi @sharpobject, you're right, there's a restriction for file size, I made it because I have a limited storage for DB. Sorry for inconveniences.

vanklompf commented 2 years ago

Maybe way to go is allowing use of larger src files but store just up to few kb of code in DB?

sharpobject commented 2 years ago

You can already submit a few megs of code. This issue is asking about submitting code that contains lookup tables that are like 70 megs or code that uses constexpr to generate these lookup tables at compile time.