by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Daniel Church
@anprogrammer
Hope your business trip goes well!
Tharindu Mathew
@mackiem
@lefticus I just got some cycles to recompile chaiscript with thread support. Performance improve is at least 10x on VS 2013. It is mind blowing. I do use multi threading but I create my own instance of chai for each (maybe not the best way, but this is only for a non interactive optimization use case, so doesn't matte if it hogs memory and cpu). Making it thread safe by design.
without thread support*
I would encourage you to release without thread support, just for the perf gains
Jason Turner
@lefticus
@mackiem I don't think I'll ever make thread-unsafe the default, it's a very easy compile time option. Been there almost since the very beginning nearly 10 years ago now
but I'm glad it worked out well for you
on my systems, with my performance tests, it's only about a 20% performance difference (mostly on Linux)
Tharindu Mathew
@mackiem
so is it just compile time option? I had to recompile chaiscript to get libs and dlls.
stdlib
Jason Turner
@lefticus
Does that mean you are using the precompiled version of ChaiScript? I rarely recommend that, since it's just a header file to include
you just have to set CHAISCRIPT_NO_THREADS
Tharindu Mathew
@mackiem
Ok, I can't remember as to why I went along this path. Is 5.8.6 header only with visual studio?
2013
Jason Turner
@lefticus
Yes, it's been header only since it was first created
you can compile the stdlib separately, but you certainly don't have to
This version is out of date for 6.0.0, but correct for 5.8.6 https://gist.github.com/lefticus/9456197#file-chaiscript_compiled_in_stdlib-cpp
Tharindu Mathew
@mackiem
Ok, cool I will try it out
So, you claim that this will be even faster with VS 2017. This is very tempting. I have a bunch of legacy code I need to clean up, but I probably will give that a try.
Jason Turner
@lefticus
Yes, not my claim, claim from the VS team
each version of VS is faster than the last version. if you move to VS2015 then also upgrade to chaiscript 6, as that is significantly faster also
Tharindu Mathew
@mackiem
but native code will be faster? That's not surely possible.
Jason Turner
@lefticus
Why not? Optimizers are always getting better with every new compiler release
plus the C++ standard library is getting more and more optimized with each new compiler release
Tharindu Mathew
@mackiem
so can we optimize our way to 8K output? :)
Jason Turner
@lefticus
Well... there's probably some limit, but we aren't there yet
Tharindu Mathew
@mackiem
Like I can understand something move operaitons being optimized or tail recursion being optimized. But, there's always a limit if you try to make your code as simple as possible
Jason Turner
@lefticus
You're mostly correct, but thinking too low level
The compilers are able to better order operations and use better CPU instructions also
better ordering means better throughput
Tharindu Mathew
@mackiem
right, as a CS person, we learn that order matters a lot
Jason Turner
@lefticus
The trivial examples we all like to show on Compiler Explorer are still trivial. Once a program reaches non-trivial size the complexities are much too hard for us to reason about generally speaking
Tharindu Mathew
@mackiem
hmmm, very interesting
so it's a never ending source of research I guess
Jason Turner
@lefticus
It is. Plus also I know something as simple as std::string is something like 3x faster from MSVC 2013 to MSVC 2017
Tharindu Mathew
@mackiem
really? wonder for what operations
seems to be across the board, that is what the results were for a JSON parser
I'm sure billy would answer questions on twitter if you asked
Tharindu Mathew
@mackiem
I wonder whether we can find ways to squeeze more perf out of gfx cards as well
Jason Turner
@lefticus
@anprogrammer any word on that pull request, I'm quite curious
Tharindu Mathew
@mackiem
@lefticus, with Summer approaching I'd like to see whether I can help this project out. Can I request a small contribution doc maybe with some high level details of architecture, which issues are best to work on, etc.?
Jason Turner
@lefticus
@mackiem I don't really have an architecture doc to point you at, but I have two suggestions
  1. There's the docs that need to be updated, like the cheatsheet and perhaps some architecture doc
  2. ChaiScript 6.0 has an optimization framework that starts with the AST and optimizes it at parse time. It is almost limitless for possibilities for transformations and optimizations that can be performed
Germán Méndez Bravo
@Kronuz
Trying to update to my project to use c++1z and it's complaining about something I just can't figure out: https://ghostbin.com/paste/vh5os any idea?
(Chaiscript 6.0)
Chris Kaminski
@ckaminski
My understanding is that 6.0 is not 1z/17 compatible.
Switch to the develop branch.
Germán Méndez Bravo
@Kronuz
oh, that must be it then
let me try
Germán Méndez Bravo
@Kronuz
There's a bunch of new things in c++17
Germán Méndez Bravo
@Kronuz
@ckaminski that did work (using development branch) thank you! :)