Skip to content
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

Performance issue #16

Open
jacob-carlborg opened this issue Apr 18, 2012 · 5 comments
Open

Performance issue #16

jacob-carlborg opened this issue Apr 18, 2012 · 5 comments

Comments

@jacob-carlborg
Copy link
Owner

Simple test-case:
http://pastebin.com/dcnm4nmA

That's around 15k keys. It takes 31 seconds to serialize. And my
structures are full of these hashes, so it would likely take an
eternity to serialize my structures with Orange.

Here's msgpack-d:
http://pastebin.com/wsRQPiDJ

6.3 milliseconds to serialize. But it takes 32 milliseconds to
unserialize, which is 5x slower. On big data structures this
difference becomes quite noticeable.

@Numpsy
Copy link

Numpsy commented Apr 18, 2012

fwiw, I tried running a profiler on that test case and that suggested that it spends most of its runtime inside Serializer.postProcessArrays().

This is DMD 2.059 on Windows, using the Sleepy profiler.

@jacob-carlborg
Copy link
Owner Author

I'm getting around 23 seconds with DMD 2.059 and around 9.5 seconds using DMD 1.072 with Tango. I'm compiling on Mac OS X 32bit.

@Numpsy
Copy link

Numpsy commented Apr 18, 2012

I get ~7 seconds on this pc, and the profiler says:

        private void postProcessArrays ()
        {
            bool foundSlice = true;

            foreach (sliceKey, slice ; serializedArrays)
            {
3.22s           foreach (arrayKey, array ; serializedArrays)
                {
0.71s               if (slice.isSliceOf(array) && slice != array)
                    {
                        auto s = Slice(slice.length, (slice.ptr - array.ptr) / slice.elementSize);
                        archive.archiveSlice(s, sliceKey, arrayKey);
0.08s                   foundSlice = true;
                        break;
                    }

                    else
0.51s                   foundSlice = false;
                }

                if (!foundSlice)
                    archive.postProcessArray(sliceKey);
            }
        }

@jacob-carlborg
Copy link
Owner Author

Thanks, I'll do some investigation. BTW, are those 7 seconds with Tango?

@Numpsy
Copy link

Numpsy commented Apr 19, 2012

Thats DMD2.059 on a 3.4ghz Intel Q6600, built with -O -inline -release. (i havent tested with noboundscheck, as i was building with xfbuild and that makes it fall over DMD bug 7478).

The same test takes ~14 seconds on the 3ghz Athlon64 X2 i have at work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants