Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^5: Bidirectional lookup algorithm? (Judy)

by BrowserUk (Patriarch)
on Jan 15, 2015 at 06:33 UTC ( [id://1113301]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Bidirectional lookup algorithm? (Judy)
in thread Bidirectional lookup algorithm? (Updated: further info.)

For the record, I finally managed to build a static 64-bit library, too.

Well done. And thank you for trying. Was that with Mingw or MSVC?

I never managed to get beyond the Too early to specify a build action 'installdeps'. Do 'Build installdeps' instead. idiocy using MSVC.

However, the Judy module that I built against the 64-bit library loaded ok, but kept crashing during the running of its test suite. In Judy.xs, I changed the hard coded "long" casts to "long long" casts. That got rid of lots of warnings during the build, but the crashing persisted. The generated Judy.c file still contained some casts to "unsigned long int" , but I couldn't immediately find what was generating those casts - at which point I totally lost interest.

It's very capable code, but the very epitome of 'macro abuse'. The only way to work out what code is actually being compiled is to use /E and wade through the post processed source, but by then, you've no idea where the code came from; or what combination of #defines, #ifdefs and #ifndefs caused it.

Like trying to listen to music by looking at an oscilloscope trace.

That's why when I came across the 1 file version I linked, I jumped at it. It at least gave me a way to get a quick feel for the performance and memory usage -- both of which are very impressive -- until you have to make the Perl->XS->C and back transitions for every lookup :(

Its not just the extra layers of function calls -- which I've tried to negate by forcing the functions to be inlined -- it also comes down to the fact that Perl code messes up the code and data caches as it leaps about all over memory chasing opcode trees. As the basis of Judy Array performance is the minimisation of cache misses, screwing with the cache between each access to those arrays, pretty much undoes everything the author worked so hard to achieve.

Also, I think that my need to use two Judy arrays in parallel does nothing to enhance the performance.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice. Agile (and TDD) debunked
  • Comment on Re^5: Bidirectional lookup algorithm? (Judy)

Replies are listed 'Best First'.
Re^6: Bidirectional lookup algorithm? (Judy)
by syphilis (Archbishop) on Jan 16, 2015 at 00:08 UTC
    Was that with Mingw or MSVC?

    That was a "./Configure" build in the msys shell using MinGW (Strawberry Perl's gcc-4.8.2).

    Like trying to listen to music by looking at an oscilloscope trace

    Nice analogy :-)
    Thanks for elaborating, also.

    Cheers,
    Rob

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1113301]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-04-19 10:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found