# MBS JSON Functions

**URL:** <https://the.fmsoup.org/t/mbs-json-functions/3845>\
**Category:** MBS Plugins\
**Created:** [December 4, 2023, 6:02pm UTC](https://the.fmsoup.org/t/mbs-json-functions/3845 "2023-12-04T18:02:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![barefoot](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/barefoot/32/2553_2.png) [@barefoot](https://the.fmsoup.org/u/barefoot)\
**Post date:** [December 4, 2023, 6:02pm UTC](https://the.fmsoup.org/t/mbs-json-functions/3845/1 "2023-12-04T18:02:13Z")

</div>

How do the MBS JSON functions perform in comparison to the build-in native FileMaker Pro JSON functions which I perceive as less performant?

---

<div class="post-metadata">

**Author:** ![jwilling](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/jwilling/32/256_2.png) [@jwilling](https://the.fmsoup.org/u/jwilling)\
**Post date:** [December 6, 2023, 6:47pm UTC](https://the.fmsoup.org/t/mbs-json-functions/3845/2 "2023-12-06T18:47:36Z")

</div>

Real good. I haven't done benchmarks but they are fundamentally different than the built-in FM JSON functions.

The MBS JSON functions parse the json and return a handle (a number). You then pass that handle around to identify which JSON is being read/modified at any time. This is much more efficient than FM's functions which pass the whole JSON string around to identify it.

Also, I believe the MBS functions can parse multiple objects at once, whereas if you jump back and forth between different JSON objects in the native functions, it has to re-parse the JSON each time!

So, if you're doing heavy JSON processing, then the MBS functions can be a huge performance win. But I'd personally avoid using them in cases where the native ones perform sufficiently well--there's no need to optimize the speed of parsing a small, say, json script parameter with a couple properties.

---

<div class="post-metadata">

**Author:** ![barefoot](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/barefoot/32/2553_2.png) [@barefoot](https://the.fmsoup.org/u/barefoot)\
**Post date:** [December 6, 2023, 8:33pm UTC](https://the.fmsoup.org/t/mbs-json-functions/3845/3 "2023-12-06T20:33:10Z")

</div>

I am not surprised to see that the plugin is more advanced then native FMP but disappointed frankly!

Thank you for your expertise @jwilling !

---

<div class="post-metadata">

**Author:** ![MonkeybreadSoftware](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/monkeybreadsoftware/32/361_2.png) [@MonkeybreadSoftware](https://the.fmsoup.org/u/MonkeybreadSoftware)\
**Post date:** [December 6, 2023, 8:49pm UTC](https://the.fmsoup.org/t/mbs-json-functions/3845/4 "2023-12-06T20:49:59Z")

</div>

Why disappointed?

You may enjoy some special functionality. Maybe just enjoy [JSON.Colorize](https://www.mbsplugins.eu/JSONColorize.shtml) to get a bit color.

Or you try our more advanced functions like the new [JSON.Query](https://www.mbsplugins.eu/JSONQuery.shtml) function and process bigger JSON data blocks into smaller items.

---

<div class="post-metadata">

**Author:** ![barefoot](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/barefoot/32/2553_2.png) [@barefoot](https://the.fmsoup.org/u/barefoot)\
**Post date:** [December 6, 2023, 9:04pm UTC](https://the.fmsoup.org/t/mbs-json-functions/3845/5 "2023-12-06T21:04:50Z")

</div>

I am very impressed by the MBS plugin. What I meant by "disappointing" is that FM or Claris is so easily outperformed by the plugin. That native FM funcitons are significantly slower (as I understood) then the plugins functions is IMHO disappointing or is it?

---

<div class="post-metadata">

**Author:** ![jwilling](https://yyz2.discourse-cdn.com/flex030/user_avatar/the.fmsoup.org/jwilling/32/256_2.png) [@jwilling](https://the.fmsoup.org/u/jwilling)\
**Post date:** [December 6, 2023, 9:21pm UTC](https://the.fmsoup.org/t/mbs-json-functions/3845/6 "2023-12-06T21:21:34Z")

</div>

@barefoot of course we'd all LOVE better performance from the native functions, but I can see why Claris implemented them as they did.

For non-programmers, the idea of returning a handle like "7" from a function like `JSONSetElement` might be intimidating, and Claris aims to be friendly for low-coders and citizen developers.

By having the function accept the whole json string as the first parameter, and return the whole json string back, it makes it a little easier to eyeball what's happening, instead of having to conceptualize what's gong on "behind the scenes".

That said, I've long thought FileMaker should give us some native `Object()` and `Array()` functions that behave like MBS plugin--and which store native FM data types like Text/Timestamp/Time etc.... These would return an object/array id (similar to MBS). Then when you want to serialize the output, they could provide us all sorts of cool serializers for different formats: `ObjectToJSON(objId)`, `ObjectToXML(objId)`, `ObjectToYAML(objId)` etc... But that's just wishful thinking, and we have MBS after all.
