Understanding Gramps 6.0

One more to add to your list in 0012394 ([Example.gramps] changes needed for v5.3): examples to test superscript/subscript markup in Notes (bug 13417),

Perhaps something like this? (copy and then paste into the Import Text gramplet):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE database PUBLIC "-//Gramps//DTD Gramps XML 1.7.1//EN"
"http://gramps-project.org/xml/1.7.1/grampsxml.dtd">
<database xmlns="http://gramps-project.org/xml/1.7.1/">
  <header>
    <created date="2025-01-16" version="5.2.4"/>
  </header>
  <notes>
    <note type="General">
      <text>Gramps 5.2 added new styling options:

To supplement Italics, Bold and Underline found in Gramps 5.1 Note styles;  Strikethrough, Superscript and Subscript text decoration buttons were added to the Gramps 5.2 Note Toolbar.</text>
      <style name="italic">
        <range start="53" end="60"/>
      </style>
      <style name="bold">
        <range start="62" end="66"/>
      </style>
      <style name="underline">
        <range start="71" end="80"/>
      </style>
      <style name="link" value="https://gramps-project.org/wiki/index.php?title=Gramps_5.1_Wiki_Manual_-_Entering_and_editing_data%3A_detailed_-_part_2#Note_tab">
        <range start="90" end="112"/>
      </style>
      <style name="strikethrough">
        <range start="115" end="128"/>
      </style>
      <style name="superscript">
        <range start="130" end="135"/>
      </style>
      <style name="subscript">
        <range start="146" end="149"/>
      </style>
      <style name="link" value="https://gramps-project.org/wiki/index.php?title=Gramps_5.2_Wiki_Manual_-_Entering_and_editing_data%3A_detailed_-_part_2#Note_Toolbar">
        <range start="198" end="221"/>
      </style>
    </note>
  </notes>
</database>

Added link to the original posting to complement the Gramps Web link.
(Where do we begin collating example files for 5.2)

As I continue testing and exploring the new JSON data representation for Gramps 6.0, I’ve been comparing Gramps 5.2 code with variations in the current Gramps codebase.

I was looking the the utility tool “Find database loop” and thinking that almost every bit of Gramps could use a performance review. Is this the best way to compute this function? What items effect performance? I’ve started to dig into libgedcom, but that is fairly complex code. More on that later.

For findloop.py I found on a medium-sized family tree of about 40k people:

Scenario Time in seconds (lower is better)
Gramps 5.2 9.90
Gramps master (JSON data) 14.21
… Plus, use CacheProxyDb 11.27
… Plus, turning off GUI update for each person 9.82
… Plus, only use “raw data” 6.83
… Plus, use orjson, specialized JSON reader 2.91

As noted before, just changing Gramps 5.2 pickled blobs to Gramps 6.0 JSON data is a bit more expensive, and that is visible in the first 2 lines. (We have not exhausted all of the possible performance possibilities with JSON yet I will note [NOTE: just added bottom line]).

But there are a lot of other things that effect performance. Lines 3 and 4 show caching and GUI update effects.

Finally, taking advantage of the JSON representation (using DataDict) allows not needed to create full Python objects, like Person() and Family(). There we can gain back advantages lost by not using fast-unpickling, and even beat Gramps 5.2.

General lessons in exploring performance:

  1. No need to update the GUI too much
  2. The cache is useful (and we can improve that across the board)
  3. Don’t use view models as a storage system; update them when done
  4. Take advantage of the “raw data” methods when possible
  5. Different OSes and machines will have different relative values for each scenario
1 Like

Just updated the chart above to use a fast JSON loader. [Thanks @Nick-Hall for introducing me to the orjson library]

Yes. It’s fast and available on most platforms including MSYS2 for Windows.

Please can we stop adding new features though. I think that we have enough for 6.0.

I don’t mind making an exception for orjson though. It is a sensible enhancement to include.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.