On Aug 29, 2013, at 4:48 PM, Tom Browder wrote:
> On Thu, Aug 29, 2013 at 3:23 PM, Christopher Sean Morrison <[email protected]>
> wrote:
> On Aug 29, 2013, at 10:38 AM, Tom Browder <[email protected]> wrote:
>> But it probably ought to be some kind of time struct (as you mentioned) on
>> the object itself. I'll look into that instead of the attribute route.
>
> I think it'll be a noticeable performance difference if I wanted to show
> "recently changed" objects, for example. Scanning 10k strings vs 10k
> timestamps could be the difference between a 1ms realtime update and 100ms
> pauses in an interface (if done blocking of course).
>
> I thought you argued that string time stamps use too much memory and disk
> space? Isn't it faster to scan integers than strings?
Yeah, I was attempting to reiterating that point with numbers, but they got
swapped in that sentence. Long day. The 1ms goes with the 10k int timestamps,
100ms with 10k string comparisons.
> My thought on the time stamps was to keep the time_t integer (wherever) and
> just convert it to a string when needed (probably rarely). Is there a
> performance hit to attaching pointers to objects?
Sounds quite reasonable to me. It fits the object data model best (as it is
metadata) to store them in the database record as a set of attributes, ideally
as binary int64 values but that's a problem we'll have to sort out.
There's usually a performance hit if/when adding a pointer makes the structure
exceed some alignment or cache size (assuming a smaller size is possible) or
when the data being pointed to is smaller than the pointer itself. I wouldn't
worry about it too much without a profile unless it's a small structure or in a
performance-critical loop. Any ideas on how to regression test database
loading performance? Maybe calculate objects/sec for reading and writing?
Interestingly related, bu_gettime() actually returns the number of
*microseconds* since 1970 for non-Windows platforms. Windows would need some
changes, but it could be modified to do that too. Just a thought as a way to
minimize/reuse the API...
Cheers!
Sean
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-devel