Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 15:06

    ldionne on gh-pages

    Update benchmarks to 490dbf6 fo… (compare)

  • Jan 24 07:47

    ldionne on gh-pages

    Update benchmarks to 490dbf6 fo… (compare)

  • Jan 23 02:04
    pthom commented #432
  • Jan 18 12:46

    ldionne on gh-pages

    Update benchmarks to 490dbf6 fo… (compare)

  • Jan 16 22:27
    ricejasonf commented #434
  • Jan 05 06:22
    ricejasonf commented #330
  • Jan 03 11:40

    ldionne on gh-pages

    Update benchmarks to 490dbf6 fo… (compare)

  • Jan 02 00:33
    ricejasonf closed #434
  • Jan 02 00:33
    ricejasonf commented #434
  • Jan 02 00:04
    ricejasonf opened #434
  • Dec 27 2018 13:11

    ldionne on gh-pages

    Update benchmarks to 490dbf6 fo… (compare)

  • Dec 22 2018 11:56
    pthom commented #432
  • Dec 22 2018 11:55
    pthom commented #432
  • Dec 21 2018 15:48
    pthom synchronize #432
  • Dec 21 2018 09:19
    sdebionne opened #433
  • Dec 21 2018 00:08
    ricejasonf commented #432
  • Dec 21 2018 00:03
    ricejasonf commented #432
  • Dec 20 2018 23:36
    pthom commented #432
  • Dec 20 2018 23:36
    pthom commented #432
  • Dec 20 2018 23:13
    ricejasonf commented #432
Maik Klein
@MaikKlein
and with 1000 integers it completes in 0.5 seconds.
I am scared to try to compile 100k integers :D
okay I run out of memory
dmd failed with exit code -9. This may indicate that the process has run out of memory.
dub build  4.96s user 4.16s system 35% cpu 25.502 total
Jason Rice
@ricejasonf
What is the 'string' that you are building?
Maik Klein
@MaikKlein
enum types = "AliasSeq!(" ~ iota(0,100000).map!(i => to!string(i)).join(",") ~ ")";
You can basically just use any runtime function at compile time in D
so I just create a list of "1,2,3,4,5,6,7,8,...."
and create a new type tuple based of it AliasSeq!(1,2,3,4,5,6,7,8,....)
do you want to test it yourself?
Jason Rice
@ricejasonf
oh lol.. so kind of like what the eruby stuff is doing
it looks the same too
Maik Klein
@MaikKlein
yeah just with the time that eruby takes
btw how far can you go in hana?
on your machine? for filter for example
for me in D it is somewhere between 10k and 100k that I run out of memory
Jason Rice
@ricejasonf
It would probably take a long time to get to 10k if it could :P
but hana:tuple would have to store each value wrapped in an integral_constant
I think we would have to make something like hana::experimental::types for integrals for it to be a fair comparison
Maik Klein
@MaikKlein
I can filter a type tuple of size 1000 a 100times and it takes 0.65seconds.
Jason Rice
@ricejasonf
what is the filter predicate?
Maik Klein
@MaikKlein
enum isEven(alias i) = i % 2 is 0;
Jason Rice
@ricejasonf
are you saying that i is a type?
Maik Klein
@MaikKlein
no it just needs to support the modulo operator
in this case its a type tuple with ulongs
so kinda big
nvm
it is also of type int
Maik Klein
@MaikKlein
okay it seemed to cache the type instantiations, so I mixed it up filtering 100 times a 1000 element list with isEven takes 10 seconds.
it still fails if I try to filter a 10k list 10 times
Maik Klein
@MaikKlein
filtering 20 times a 1000 element list takes 20 seconds. I'll do "real" benchmarks later.
Unfortunately with libstdc++ it blows up at 256 recursive template instantiations inside std::make_index_sequence (I think)
that filter function is optimized for integrals (I think :grin: )
so it should be more "apples to apples" for your comparison
Jason Rice
@ricejasonf
So, on my intel-nuc it takes .17s for 250. 250 on my macbook air takes .27s. 10k on my air takes .8s
6.1s with 100k
Jason Rice
@ricejasonf
1M explodes with a message about a possible infinite loop at 46s :laughing:
500k isn't much better
Jason Rice
@ricejasonf
So D doesn't look like a panacea for metaprogramming, but that static if thing looks like it could save some headaches.
Jason Rice
@ricejasonf
I heard they are trying to get something like if constexpr(x) in C++17.
Maik Klein
@MaikKlein
I just created a small framework that generates some code at runtime into a string, creates a file, compiles the created file and measures the time.
filtering 100k elements takes 100s
while 10k takes 1.6s
Jason Rice
@ricejasonf
that's with pregenerating the code before the benchmark?
Maik Klein
@MaikKlein
I don't even know why it takes that long for 100k elements, I still have enough ram left.
yeah
Actually c++ is surprisingly fast
Jason Rice
@ricejasonf
did you try the c++ version with the pregenerated code? I bet std::make_range is the slowdown